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

Release jobs #370

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ This project requires docker and docker compose. The docker version must be late

Release `v3.0` is the first stable and reviewed version of SciCatLive.

## Create the release-jobs DEV environment

To start the containers in DEV mode with JOBS settings, set the env variables `DEV=true` and `JOBS_ENABLED=true` [here](.env). This will start the backend and the frontend in development mode with code checkout out at `#release-jobs` branch, including the requirements to run tests.

## Steps

<details markdown="1">
Expand Down
1 change: 1 addition & 0 deletions services/backend/services/v4/.compose.jobs.yaml
5 changes: 5 additions & 0 deletions services/backend/services/v4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ If `OIDC_ENABLED` is toggled, you can use OIDC to log in with a [OIDC user](../k

With `DEV=true`, since the container might have limited memory, it is recommended to run unit tests with the option `--runInBand`, as [here](./entrypoints/tests.sh), which makes the tests run sequentially, avoiding to fill the RAM which makes them freeze.

With `DEV=true` and `JOBS_ENABLED=true` containers in `DEV` mode is created with code checkout out at `#release-jobs` branch, in a dedicated docker volume: `v4_jobs_dev`. As docker caches images, it is recommended to run `npm install` whenever rerunning `docker compose up -d`, or rebuild the image without cache with:
```bash
docker compose up -d --build
```

## Dependencies

Here below we show the internal dependencies of the service, which are not already covered [here](../../../../README.md) and [here](../../README.md) (if `B` depends on `A`, then we visualize as `A --> B`). The same subdomain to service convention applies.
Expand Down
16 changes: 16 additions & 0 deletions services/backend/services/v4/compose.jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
backend:
build:
context:
https://github.com/SciCatProject/scicat-backend-next.git#release-jobs
environment:
GITHUB_REPO:
https://github.com/SciCatProject/scicat-backend-next.git#release-jobs
env_file:
- ./config/.jobs.env
volumes:
- v4_jobs_dev:${WORKDIR:-/home/node/app}

volumes:
v4_jobs_dev:
driver: local
1 change: 1 addition & 0 deletions services/backend/services/v4/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include:
- .${ELASTIC_ENABLED:+/}compose.elastic.yaml
- .${DEV:+/}compose.dev.yaml
- .${KEYCLOAK_HTTPS_URL:+/}compose.https.yaml
- .${DEV:+${JOBS_ENABLED:+/}}compose.jobs.yaml
4 changes: 4 additions & 0 deletions services/backend/services/v4/config/.jobs.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE_JOB_GROUPS=group1,group2
UPDATE_JOB_GROUPS=group1
DELETE_JOB_GROUPS=archivemanager
JOB_CONFIGURATION_FILE=test/config/jobconfig.yaml
1 change: 1 addition & 0 deletions services/frontend/.compose.jobs.yaml
5 changes: 5 additions & 0 deletions services/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ Since there was a small breaking change from `v3` to `v4`, when connecting to th

With `DEV=true`, please use `npm start -- --host 0.0.0.0`. This is to allow traffic from any IP to the `frontend` component and it is necessary since the component runs in the docker network.

With `DEV=true` and `JOBS_ENABLED=true` containers in `DEV` mode is created with code checkout out at `#release-jobs` branch, in a dedicated docker volume: `frontend_jobs_dev`. As docker caches images, it is recommended to run `npm install` whenever rerunning `docker compose up -d`, or rebuild the image without cache with:
```bash
docker compose up -d --build
```

Setting the [BACKEND_HTTPS_URL env variable](../../.env) requires changing the `backend` URL used by the `frontend`. This is managed [here](../../entrypoints/merge_json.sh).

:warning: When setting `FRONTENT_HTTPS_URL` it is likely you also want to set the `BACKEND_HTTPS_URL`, to allow the communication between the two wherever the browser is accessed.
12 changes: 12 additions & 0 deletions services/frontend/compose.jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
frontend:
build:
context: https://github.com/SciCatProject/frontend.git#release-jobs
environment:
GITHUB_REPO: https://github.com/SciCatProject/frontend.git#release-jobs
volumes:
- frontend_jobs_dev:${WORKDIR:-/home/node/app}

volumes:
frontend_jobs_dev:
driver: local
1 change: 1 addition & 0 deletions services/frontend/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include:
- .${OIDC_ENABLED:+/}compose.oidc.yaml
- .${LDAP_ENABLED:+/}compose.ldap.yaml
- .${DEV:+/}compose.dev.yaml
- .${DEV:+${JOBS_ENABLED:+/}}compose.jobs.yaml