- André Costa Lima (up202008169)
- Eduardo Luís Tronjo Ramos (up201906732)
- Fábio Araújo de Sá (up202007658)
- Inês Sá Pereira Estêvão Gaspar (up202007210)
- Clone the repository
- Run the containers using Docker Compose with
docker compose up --force-recreate --build --watch
. On Windows, you need to usedocker compose up --force-recreate --build --wait setup_workspace_script; docker compose up --force-recreate --build --watch
instead. - The containers will automatically restart when you make changes to the source code, including to the respective dependencies.
Dependencies installed in containers are not detected by your IDE. As such, you will need to install the dependencies locally.
To do that, run the following commands:
-
Create a virtual environment
python -m venv .venv
-
Activate the virtual environment
source .venv/bin/activate
-
Install poetry
pip install -r poetry-requirements.txt
-
Install the dependencies for each of the applications and packages
poetry install --no-root -C packages/cert_manager poetry install --no-root -C packages/nonce poetry install --no-root -C packages/secure_endpoints poetry install --no-root -C packages/utils # Remove lockfiles from the packages rm packages/cert_manager/poetry.lock rm packages/nonce/poetry.lock rm packages/secure_endpoints/poetry.lock rm packages/utils/poetry.lock poetry install -C apps/authentication_server poetry install -C apps/authorization_server poetry install -C apps/resource_server poetry install -C apps/web_server
-
Use the virtual environment in
.venv
as your Python interpreter in your IDE.
Dependencies are managed using Poetry.
To add a new dependency to a package or app:
-
Create a new virtual environment
python -m venv .venv
-
Activate the virtual environment
source .venv/bin/activate
-
Install poetry
pip install -r poetry-requirements.txt
-
Go to the package you want to add the dependency to
cd apps/authentication_server
-
Install the dependency using poetry
# poetry add <dependency> poetry add Flask # example for a PyPI dependency poetry add ../../packages/cert_manager -e # example for a local dependency
-
If the installed dependency is a local dependency, you will need to:
-
update
deploy/apps.containerfile
to include the new dependency.FROM local_packages AS authentication_server_local_packages + COPY ./packages/cert_manager ./packages/cert_manager/
-
update
compose.yml
andcompose.prod.yml
to include the new dependency.services: authentication_server: ... develop: watch: ... - path: ./apps/authentication_server/poetry.lock target: /app/apps/authentication_server/poetry.lock action: rebuild + - path: ./packages/cert_manager + target: /app/packages/cert_manager + action: sync # Or `sync+restart`, if in compose.prod.yml
-