Skip to content

Commit

Permalink
refactor: promp selector and prompted skill dockerfiles (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatovFedor authored May 1, 2023
1 parent 1acc382 commit 198f055
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
18 changes: 8 additions & 10 deletions annotators/prompt_selector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM python:3.8.4

ARG SERVICE_PORT
ENV SERVICE_PORT ${SERVICE_PORT}
ARG N_SENTENCES_TO_RETURN
ENV N_SENTENCES_TO_RETURN ${N_SENTENCES_TO_RETURN}
ARG PROMPTS_TO_CONSIDER
ENV PROMPTS_TO_CONSIDER ${PROMPTS_TO_CONSIDER}

RUN mkdir /src
WORKDIR /src

COPY annotators/prompt_selector/requirements.txt /src/requirements.txt
RUN pip install -r /src/requirements.txt
RUN pip install --no-cache -r /src/requirements.txt

COPY ./annotators/prompt_selector/ /src/
COPY ./common/ /src/common/

WORKDIR /src
ARG SERVICE_PORT
ENV SERVICE_PORT ${SERVICE_PORT}
ARG N_SENTENCES_TO_RETURN
ENV N_SENTENCES_TO_RETURN ${N_SENTENCES_TO_RETURN}
ARG PROMPTS_TO_CONSIDER
ENV PROMPTS_TO_CONSIDER ${PROMPTS_TO_CONSIDER}

CMD gunicorn --workers=1 server:app --bind 0.0.0.0:8000
17 changes: 8 additions & 9 deletions skills/dff_template_prompted_skill/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ FROM python:3.9.1
# Do not change anything in this section
WORKDIR /src

COPY common/dff/requirements.txt .
RUN pip install -r requirements.txt
COPY common/dff/requirements.txt common-reqs.txt
COPY skills/dff_template_prompted_skill/requirements.txt .
RUN pip install --no-cache -r common-reqs.txt -r requirements.txt

RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"

# ###################### CUSTOM SECTION ######################################
# Here you can make changes

COPY skills/dff_template_prompted_skill/ ./
COPY ./common/ ./common/

ARG SERVICE_NAME
ENV SERVICE_NAME ${SERVICE_NAME}
ARG SERVICE_PORT
Expand All @@ -28,11 +34,4 @@ ENV ENVVARS_TO_SEND ${ENVVARS_TO_SEND}
ARG ALLOW_PROMPT_RESET=0
ENV ALLOW_PROMPT_RESET ${ALLOW_PROMPT_RESET}

COPY skills/dff_template_prompted_skill/requirements.txt .
RUN pip install -r requirements.txt
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"

COPY skills/dff_template_prompted_skill/ ./
COPY ./common/ ./common/

CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT}

0 comments on commit 198f055

Please sign in to comment.