Skip to content

Commit

Permalink
updates to dockerfile and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jleaniz committed Sep 13, 2023
1 parent bb18d7b commit 692188d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
run: |
docker exec -u root -t turbinia-worker bash -c "/usr/bin/python -m pip install --quiet --upgrade pip"
docker exec -u root -t turbinia-worker bash -c "/usr/bin/python -m pip install --quiet poetry"
docker exec -u root -t turbinia-worker bash -c "cd /tmp && poetry config virtualenvs.create false && poetry install --with worker --with gcp --with test"
docker exec -u root -t turbinia-worker bash -c "cd /tmp && poetry config virtualenvs.in-project true && poetry install -E worker -E gcp --with test"
- name: Run Tests
run: |
docker exec -u root -t turbinia-worker bash -c "cd /tmp && /usr/bin/python ./run_tests.py"
docker exec -u root -t turbinia-worker bash -c "cd /tmp && tox --sitepackages ${TOXENV}"
docker exec -u root -t turbinia-worker bash -c "cd /tmp && ./venv/bin/python ./run_tests.py"
docker exec -u root -t turbinia-worker bash -c "cd /tmp && ./venv/bin/tox --sitepackages ${TOXENV}"
5 changes: 2 additions & 3 deletions docker/api_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ COPY --from=build-stage /tmp/web/dist /web/dist
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install git python3-pip python3.10-venv
RUN pip3 install pip --upgrade
RUN pip3 install poetry
RUN python3 -m venv /venv

COPY . /tmp/
Expand All @@ -24,14 +23,14 @@ RUN if $(cd /tmp/ && git rev-parse --is-shallow-repository); then cd /tmp/ && gi

# Build and install the package wheel using pip (will pull dependencies from pyproject.toml)
ENV PATH="/venv/bin:$PATH" VIRTUAL_ENV=/venv
RUN cd /tmp/ && pip3 install wheel && pip3 install .[worker]
RUN cd /tmp/ && pip3 install wheel && pip3 install .

# Final stage contains python and the virtualenv built in stage2
FROM ubuntu:22.04 as build-final

COPY --from=build-stage2 /venv /venv
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install python3
RUN apt-get -y install python3-pip
RUN useradd -r -s /bin/nologinpoet -u 999 turbinia
RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia/ \
&& mkdir -p /var/log/turbinia/ && chown -R turbinia:turbinia /mnt/turbinia/ \
Expand Down

0 comments on commit 692188d

Please sign in to comment.