Skip to content

Commit

Permalink
Merge pull request #164 from QCDIS/163-vreapiv108-beta-crashes-with-m…
Browse files Browse the repository at this point in the history
…odulenotfounderror-no-module-named-django-keycloak-auth

fix 163, add image testing, enable dependabot on vreapi
  • Loading branch information
gpelouze authored Oct 31, 2023
2 parents 728d91e + 8208f87 commit fb9a88c
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 34 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ updates:
schedule:
interval: "monthly"

- package-ecosystem: "pip"
directory: "vreapis"
schedule:
interval: "monthly"
commit-message:
prefix: "[pip] "

- package-ecosystem: "npm"
directory: "vre-panel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,30 @@ jobs:
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v4

- name: Build docker
run: |
cd $DOCKER_FOLDER && docker build . --file Dockerfile -t $TAG --build-arg "NODE_ENV=${{ inputs.environment }}"
- name: Run docker compose
uses: isbang/[email protected]
with:
compose-file: "${{ inputs.docker_folder }}/docker-compose.yaml"

- name: Wait for healthy app
uses: raschmitt/wait-for-healthy-container/@v1
with:
container-name: app
timeout: 120

- name: Login to github Registry
if: ${{ inputs.push }}
uses: docker/login-action@v3
with:
registry: "https://index.docker.io/v1/"
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_password }}

- name: Push image to container Registry
if: ${{ inputs.push }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
call-build-container-vreapis:
uses: ./.github/workflows/build-container.yml
uses: ./.github/workflows/ci-pipeline.yml
with:
docker_folder: vreapis
tag: vreapi
Expand All @@ -16,7 +16,7 @@ jobs:
docker_password: ${{ secrets.DOCKERHUB_PASSWORD }}

call-build-container-vre-panel:
uses: ./.github/workflows/build-container.yml
uses: ./.github/workflows/ci-pipeline.yml
strategy:
matrix:
environment:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: make
on:
push:
branches:
- '**'
tags-ignore:
- '**'
schedule:
- cron: '0 4 5,25 * *'

jobs:
call-build-container-vreapis:
uses: ./.github/workflows/build-container.yml
uses: ./.github/workflows/ci-pipeline.yml
with:
docker_folder: vreapis
tag: vreapi
Expand All @@ -16,7 +20,7 @@ jobs:
docker_password: ${{ secrets.DOCKERHUB_PASSWORD }}

call-build-container-vre-panel:
uses: ./.github/workflows/build-container.yml
uses: ./.github/workflows/ci-pipeline.yml
strategy:
matrix:
environment:
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ conda env update --file environment.yaml
#### Install GitGuardian pre-commit hook

```
pip install pre-commit
pre-commit install
pip install ggshield
ggshield auth login
```

Expand Down
17 changes: 3 additions & 14 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@ channels:
- conda-forge
dependencies:
- python>=3.9
- djangorestframework
- pip
- tilt
- django>=4.0.0,<4.1.0
- minikube
- requests
- whitenoise
- gunicorn
- pyyaml
- python-dotenv
- django-cors-headers
- django-extensions
- pre_commit





- pip:
- ggshield
16 changes: 16 additions & 0 deletions vre-panel/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
app:
image: vreapp
container_name: app
env_file:
- .env.test
environment:
- AUTH0_ID=
- AUTH0_ISSUER=
- SECRET=secret
ports:
- '127.0.0.1:3000:3000'
healthcheck:
test: |
wget http://localhost:3000/vreapp/ -O -
interval: 5s
43 changes: 43 additions & 0 deletions vreapis/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
services:
db:
image: postgis/postgis:15-3.4
environment:
- POSTGRES_DB=vrepaas
- POSTGRES_PASSWORD=vrepaas
- POSTGRES_USER=vrepaas

app:
image: vreapi
container_name: app
environment:
- DB_HOST=db
- DB_NAME=vrepaas
- DB_PASSWORD=vrepaas
- DB_PORT=5432
- DB_USER=vrepaas
- ALLOWED_HOST=*
- ARGO_NAMESPACE=
- ARGO_URL=
- BASE_PATH=/vre-api-test
- CALL_BACK_URL=
- CORS_ALLOWED_ORIGIN_REGEXES=
- DJANGO_SETTINGS_MODULE=vreapis.settings.development
- [email protected]
- DJANGO_SUPERUSER_USERNAME=admin
- DJANGO_USERNAME=user
- KEYCLOAK_CLIENT_ID=
- KEYCLOAK_REALM=
- KEYCLOAK_SERVER_URL=
- TRUSTED_ORIGINS=http://localhost
- ARGO_API_TOKEN=
- DJANGO_PASSWORD=user
- DJANGO_SUPERUSER_PASSWORD=admin
- DJANGO_TOKEN=token
- KEYCLOAK_CLIENT_SECRET_KEY=
- SECRET_KEY=secret
ports:
- '127.0.0.1:8000:8000'
healthcheck:
test: |
curl --fail http://localhost:8000/vre-api-test/api/
interval: 5s
28 changes: 14 additions & 14 deletions vreapis/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
django>=4.0.0,<4.1.0
djangorestframework
djangorestframework-gis~=1.0.0
django-filter~=22.1.0
whitenoise
django-keycloak-auth
python-keycloak
gunicorn
pyyaml
requests
django-dotenv
django-cors-headers
django-extensions
django==4.0.10
djangorestframework==3.14.0
djangorestframework-gis==1.0
django-filter==22.1
whitenoise==6.5.0
django-keycloak-auth==0.9.6
python-keycloak==3.3.0
gunicorn==21.2.0
pyyaml==6.0.1
requests==2.31.0
django-dotenv==1.4.2
django-cors-headers==4.2.0
django-extensions==3.2.3
psycopg2==2.9.5
django-probes~=1.7.0
django-probes==1.7.0

0 comments on commit fb9a88c

Please sign in to comment.