-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,16 +37,19 @@ runs: | |
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ inputs.ghcr-pat }} | ||
|
||
- name: Start server based on released version | ||
if: ${{ inputs.jimm-version != 'dev' }} | ||
run: make integration-test-env | ||
shell: bash | ||
env: | ||
JIMM_VERSION: ${{ inputs.jimm-version }} | ||
|
||
- name: Start server based on development version | ||
if: ${{ inputs.jimm-version == 'dev' }} | ||
run: make dev-env | ||
shell: bash | ||
|
||
- name: Initialise LXD | ||
run: | | ||
sudo lxd waitready && \ | ||
|
@@ -55,32 +58,39 @@ runs: | |
lxc network set lxdbr0 ipv6.address none && \ | ||
sudo usermod -a -G lxd $USER | ||
shell: bash | ||
|
||
- name: Setup cloud-init script for bootstraping Juju controllers | ||
run: ./local/jimm/setup-controller.sh | ||
shell: bash | ||
env: | ||
SKIP_BOOTSTRAP: true | ||
CLOUDINIT_FILE: "cloudinit.temp.yaml" | ||
|
||
- name: Setup Juju Controller | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: "lxd" | ||
channel: "5.19/stable" | ||
juju-channel: ${{ inputs.juju-channel }} | ||
bootstrap-options: "--config cloudinit.temp.yaml --config login-token-refresh-url=https://jimm.localhost/.well-known/jwks.json" | ||
|
||
# As described in https://github.com/charmed-kubernetes/actions-operator grab the newly setup controller name | ||
- name: Save LXD controller name | ||
id: lxd-controller | ||
run: echo "name=$CONTROLLER_NAME" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Install jimmctl and yq | ||
run: sudo snap install jimmctl --channel=3/stable && sudo snap install yq | ||
shell: bash | ||
|
||
- name: Authenticate Juju CLI | ||
run: chmod -R 666 ~/.local/share/juju/*.yaml && ./local/jimm/setup-cli-auth.sh | ||
shell: bash | ||
# Below is a hardcoded JWT using the same test-secret used in JIMM's docker compose and allows the CLI to authenticate as the [email protected] user. | ||
env: | ||
JWT: ZXlKMGVYQWlPaUpLVjFRaUxDSmhiR2NpT2lKSVV6STFOaUo5LmV5SnBjM01pT2lKUGJteHBibVVnU2xkVUlFSjFhV3hrWlhJaUxDSnBZWFFpT2pFM01qUXlNamcyTmpBc0ltVjRjQ0k2TXprMk5EYzFNelEyTUN3aVlYVmtJam9pYW1sdGJTSXNJbk4xWWlJNkltcHBiVzB0ZEdWemRFQmpZVzV2Ym1sallXd3VZMjl0SW4wLkpTWVhXcGF6T0FnX1VFZ2hkbjlOZkVQdWxhWWlJQVdaX3BuSmRDbnJvWEk= | ||
|
||
- name: Add LXD Juju controller to JIMM | ||
run: ./local/jimm/add-controller.sh | ||
shell: bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ services: | |
|
||
# An instance of JIMM used in integration tests, pulled from a tag. | ||
jimm-test: | ||
extends: jimm | ||
image: ghcr.io/canonical/jimm:${JIMM_VERSION} | ||
profiles: ["test"] | ||
container_name: jimm-test | ||
|
@@ -32,31 +33,9 @@ services: | |
- -c | ||
- >- | ||
apt update && apt install curl -y | ||
&& set -a && . /test.env && . /vault/vault.env && set +a && /usr/local/bin/jimmsrv | ||
&& set -a && . /vault/vault.env && set +a && /usr/local/bin/jimmsrv | ||
volumes: | ||
- ./local/vault/vault.env:/vault/vault.env:rw | ||
- ./test.env:/test.env | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://jimm.localhost:80" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 # Should fail after approximately (interval*retry) seconds | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
openfga: | ||
condition: service_healthy | ||
traefik: | ||
condition: service_healthy | ||
insert-hardcoded-auth-model: | ||
condition: service_completed_successfully | ||
keycloak: | ||
condition: service_healthy | ||
labels: | ||
traefik.enable: true | ||
traefik.http.routers.jimm.rule: Host(`jimm.localhost`) | ||
traefik.http.routers.jimm.entrypoints: websecure | ||
traefik.http.routers.jimm.tls: true | ||
|
||
# An instance of JIMM used for dev, built from source. | ||
jimm: | ||
|
@@ -75,6 +54,43 @@ services: | |
ports: | ||
- 17070:80 | ||
- 2345:2345 | ||
environment: | ||
JIMM_LOG_LEVEL: "debug" | ||
JIMM_UUID: "3217dbc9-8ea9-4381-9e97-01eab0b3f6bb" | ||
JIMM_DSN: "postgresql://jimm:jimm@db/jimm" | ||
# Not needed for local test (yet). | ||
# BAKERY_AGENT_FILE: "" | ||
JIMM_ADMINS: "[email protected]" | ||
# Note: You can comment out the Vault ENV vars below and instead use INSECURE_SECRET_STORAGE to place secrets in Postgres. | ||
VAULT_ADDR: "http://vault:8200" | ||
VAULT_PATH: "/jimm-kv/" | ||
# Note: By default we should use Vault as that is the primary means of secret storage. | ||
# INSECURE_SECRET_STORAGE: "enabled" | ||
# JIMM_DASHBOARD_LOCATION: "" | ||
JIMM_DNS_NAME: "jimm.localhost" | ||
JIMM_LISTEN_ADDR: "0.0.0.0:80" | ||
JIMM_TEST_PGXDSN: "postgresql://jimm:jimm@db/jimm" | ||
JIMM_JWT_EXPIRY: 30s | ||
JIMM_AUDIT_LOG_RETENTION_PERIOD_IN_DAYS: "1" | ||
TEST_LOGGING_CONFIG: "" | ||
BAKERY_PUBLIC_KEY: "izcYsQy3TePp6bLjqOo3IRPFvkQd2IKtyODGqC6SdFk=" | ||
BAKERY_PRIVATE_KEY: "ly/dzsI9Nt/4JxUILQeAX79qZ4mygDiuYGqc2ZEiDEc=" | ||
OPENFGA_SCHEME: "http" | ||
OPENFGA_HOST: "openfga" | ||
OPENFGA_PORT: 8080 | ||
OPENFGA_STORE: "01GP1254CHWJC1MNGVB0WDG1T0" | ||
OPENFGA_AUTH_MODEL: "01GP1EC038KHGB6JJ2XXXXCXKB" | ||
OPENFGA_TOKEN: "jimm" | ||
JIMM_IS_LEADER: true | ||
JIMM_OAUTH_ISSUER_URL: "http://keycloak.localhost:8082/realms/jimm" # Scheme required | ||
JIMM_OAUTH_CLIENT_ID: "jimm-device" | ||
JIMM_OAUTH_CLIENT_SECRET: "SwjDofnbDzJDm9iyfUhEp67FfUFMY8L4" | ||
JIMM_OAUTH_SCOPES: "openid profile email" # Space separated list of scopes | ||
JIMM_DASHBOARD_FINAL_REDIRECT_URL: "https://jaas.ai" # Example URL | ||
JIMM_ACCESS_TOKEN_EXPIRY_DURATION: 1h | ||
JIMM_SECURE_SESSION_COOKIES: false | ||
JIMM_SESSION_COOKIE_MAX_AGE: 86400 | ||
JIMM_SESSION_SECRET_KEY: Xz2RkR9g87M75xfoumhEs5OmGziIX8D88Rk5YW8FSvkBPSgeK9t5AS9IvPDJ3NnB | ||
volumes: | ||
- ./:/jimm/ | ||
- ./local/vault/vault.env:/vault/vault.env:rw | ||
|