Commit 5cae7027 authored by Raul Sirel's avatar Raul Sirel
Browse files

minor fixes

parent 85236c3a
Pipeline #4458 passed with stages
in 14 minutes and 6 seconds
#!/bin/bash
# Set default for MLP workers
export TEXTA_MLP_TASK_WORKERS="${TEXTA_MLP_TASK_WORKERS:-4}"
export TEXTA_MLP_TASK_WORKERS="${TEXTA_MLP_TASK_WORKERS:-2}"
# activate env
source activate texta-mlp
......
name: texta-mlp
channels:
- conda-forge
dependencies:
- python=3.7
- pip
- supervisor
- lxml
- pip:
- texta-mlp
- celery==5.*
- redis==3.*
FROM nvidia/cuda:11.1.1-base-ubuntu20.04
RUN apt-get update && apt-get install wget -y
# Download and install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN sh Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda && rm Miniconda3-latest-Linux-x86_64.sh
# Add conda binaries to path
ENV PATH /opt/conda/bin:$PATH
# create dir for MLP
RUN mkdir /var/texta-mlp
WORKDIR /var/texta-mlp
# install requirements
COPY ./environment-gpu.yaml ./environment.yaml
RUN conda env create -f environment.yaml \
# conda clean up
&& conda clean -afy \
&& find /opt/conda/ -follow -type f -name '*.a' -delete \
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete
# copy files
COPY ./supervisord.conf /opt/conda/envs/texta-mlp/etc/supervisord/conf.d/supervisord.conf
COPY ./entrypoint.sh ./entrypoint.sh
COPY ./settings.py ./settings.py
COPY ./taskman.py ./taskman.py
# create dir for data
RUN mkdir /var/texta-mlp/data
# Ownership to www-data and entrypoint
RUN chown -R www-data:www-data /var/texta-mlp \
&& chmod 775 -R /var/texta-mlp \
&& chmod +x /var/texta-mlp/entrypoint.sh \
&& rm -rf /root/.cache
ENTRYPOINT ["/var/texta-mlp/entrypoint.sh"]
CMD ["supervisord", "-n"]
......@@ -3,8 +3,8 @@ import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# env variables
MLP_WORKER_LANGUAGE_CODES = os.getenv("MLP_WORKER_LANGUAGE_CODES", "et").split(",")
MLP_WORKER_LANGUAGE_CODES = os.getenv("MLP_WORKER_LANGUAGE_CODES", "et,en,ru").split(",")
MLP_WORKER_DEFAULT_LANGUAGE_CODE = os.getenv("MLP_WORKER_DEFAULT_LANGUAGE_CODES", "et")
MLP_WORKER_RESOURCE_DIR = os.getenv("MLP_WORKER_RESOURCE_DIR", "/var/data")
MLP_WORKER_RESOURCE_DIR = os.getenv("MLP_WORKER_RESOURCE_DIR", "/var/texta-mlp/data")
MLP_WORKER_BROKER = os.getenv("MLP_WORKER_BROKER", "redis://mlp-redis:6379/0")
MLP_WORKER_RESULT_BACKEND = os.getenv("MLP_WORKER_RESULT_BACKEND", "redis://mlp-redis:6379/0")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment