Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev containers now work with "run as me" #1129

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ version_info.json
UNKNOWN.egg-info/
process_models/
.ipynb_checkpoints
.env*
.env*
.cache
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ all: dev-env start-dev run-pyl
build-images:
$(DOCKER_COMPOSE) build

dev-env: stop-dev build-images fe-npm-i be-recreate-db
dev-env: stop-dev build-images poetry-i be-poetry-i be-recreate-db fe-npm-i
@/bin/true

start-dev: stop-dev
Expand All @@ -47,6 +47,9 @@ be-logs:
be-mypy:
$(IN_BACKEND) poetry run mypy src tests

be-poetry-i:
$(IN_BACKEND) poetry install

be-recreate-db:
$(IN_BACKEND) ./bin/recreate_db clean

Expand Down Expand Up @@ -74,6 +77,9 @@ fe-npm-i:
fe-sh:
$(IN_FRONTEND) /bin/bash

poetry-i:
$(IN_ARENA) poetry install --no-root

pre-commit:
$(IN_ARENA) poetry run pre-commit run --verbose --all-files

Expand All @@ -88,7 +94,7 @@ take-ownership:

.PHONY: build-images dev-env \
start-dev stop-dev \
be-clear-log-file be-logs be-mypy be-recreate-db be-ruff be-sh be-tests be-tests-par \
be-clear-log-file be-logs be-mypy be-poetry-i be-recreate-db be-ruff be-sh be-tests be-tests-par \
fe-lint-fix fe-logs fe-npm-i fe-sh \
pre-commit run-pyl \
poetry-i pre-commit run-pyl \
take-ownership
5 changes: 1 addition & 4 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ RUN apt-get update \
RUN git config --global --add safe.directory /app

RUN pip install --upgrade pip
RUN pip install poetry==1.6.1

COPY pyproject.toml poetry.lock .
RUN poetry install --no-root
RUN pip install poetry==1.8.1
8 changes: 4 additions & 4 deletions dev.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ services:
build:
context: .
dockerfile: dev.Dockerfile
#
# TODO: would like to figure out the permissions issue that is preventing this
#
#user: "${RUN_AS}"
user: "${RUN_AS}"
environment:
POETRY_VIRTUALENVS_IN_PROJECT: "true"
PRE_COMMIT_HOME: "/app/.cache/pre-commit"
volumes:
- ./:/app
10 changes: 3 additions & 7 deletions spiffworkflow-backend/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ WORKDIR /app
RUN apt-get update \
&& apt-get install -y -q \
gcc libssl-dev libpq-dev default-libmysqlclient-dev \
pkg-config libffi-dev git-core curl
pkg-config libffi-dev git-core curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip
RUN pip install poetry==1.8.1 pytest-xdist==3.5.0

COPY pyproject.toml poetry.lock .
RUN poetry install --no-root

COPY ./ ./
RUN poetry install --only-root

CMD ["./bin/run_server_locally"]
7 changes: 3 additions & 4 deletions spiffworkflow-backend/dev.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ services:
build:
context: spiffworkflow-backend
dockerfile: dev.Dockerfile
#
# TODO: would like to figure out the permissions issue that is preventing this
#
#user: "${RUN_AS}"
user: "${RUN_AS}"
environment:
FLASK_DEBUG: "1"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
POETRY_CACHE_DIR: "/app/.cache/poetry"
SPIFFWORKFLOW_BACKEND_DATABASE_URI: ""
SPIFFWORKFLOW_BACKEND_ENV: "local_development"
SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA: ""
Expand Down
Loading