Skip to content

Commit

Permalink
Try reverting things pointed out by pjonsson properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul committed Aug 20, 2024
1 parent 7071bde commit bf41dd9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ jobs:
- name: Test and lint dev OWS image
run: |
mkdir artifacts
chmod 777 artifacts
docker run -e LOCAL_UID=1000 -e LOCAL_GID=1000 -u ubuntu -v ${PWD}/artifacts:/mnt/artifacts ${ORG}/${IMAGE}:_builder /bin/sh -c "cd /code && ./check-code.sh"
docker run -e LOCAL_UID=$(id -u $USER) -e LOCAL_GID=$(id -g $USER) -v ${PWD}/artifacts:/mnt/artifacts ${ORG}/${IMAGE}:_builder /bin/sh -c "cd /code && ./check-code.sh"
mv ./artifacts/coverage.xml ./artifacts/coverage-unit.xml
- name: Dockerized Integration Pytest
run: |
export $(grep -v '^#' .env_simple | xargs)
export LOCAL_UID=$(id -u $USER)
export LOCAL_GID=$(id -g $USER)
docker compose -f docker-compose.yaml -f docker-compose.db.yaml up -d --wait --build
docker compose -f docker-compose.yaml -f docker-compose.db.yaml exec -u ubuntu -T ows /bin/sh -c "cd /code && ./check-code-all.sh"
docker compose -f docker-compose.yaml -f docker-compose.db.yaml exec -T ows /bin/sh -c "cd /code && ./check-code-all.sh"
docker compose -f docker-compose.yaml -f docker-compose.db.yaml down
- name: Upload All coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ RUN EXTRAS=$([ "$ENVIRONMENT" = "deployment" ] || echo ",test") && \
python3-pip))

# Configure user
USER ubuntu
RUN useradd -m -s /bin/bash ows
WORKDIR "/home/ubuntu"

ENV GDAL_DISABLE_READDIR_ON_OPEN="EMPTY_DIR" \
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# override default compose to change the launch command

services:
ows_18:
ows:
command: gunicorn -b '0.0.0.0:8000' --workers=3 -k gevent --timeout 121 --pid /home/ubuntu/gunicorn.pid --log-level info --worker-tmp-dir /dev/shm --config python:datacube_ows.gunicorn_config datacube_ows.wsgi
6 changes: 3 additions & 3 deletions docker/files/remap-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
USER_ID=${LOCAL_UID:-1000}
GROUP_ID=${LOCAL_GID:-1000}

[[ "$USER_ID" == "1000" ]] || usermod -u $USER_ID -o -m -d /home/ows ows
[[ "$GROUP_ID" == "1000" ]] || groupmod -g $GROUP_ID ows
[[ $(id -u) != "0" ]] || GOSU="/usr/sbin/gosu ows"
[[ "$USER_ID" == "1000" ]] || usermod -u $USER_ID -o -m -d /home/ows ubuntu
[[ "$GROUP_ID" == "1000" ]] || groupmod -g $GROUP_ID ubuntu
[[ $(id -u) != "0" ]] || GOSU="/usr/sbin/gosu ubuntu"
exec /usr/bin/tini -- $GOSU "$@"

0 comments on commit bf41dd9

Please sign in to comment.