diff --git a/devel/.env b/devel/.env index 2c7cec66..c0ca9457 100644 --- a/devel/.env +++ b/devel/.env @@ -3,4 +3,5 @@ CERT_DIR=./state/x509 COMPOSER_CONFIG_DIR=./config/composer WORKER_CONFIG_DIR=./config/worker SPANDX_CONFIG=./config/spandx/local-frontend-and-api.js -COMPOSER_OFFLINE_TOKEN=someOfflineToken +COMPOSER_CLIENT_ID=rhsm-api +COMPOSER_CLIENT_SECRET=supersecretsecretsquirrel diff --git a/devel/README.md b/devel/README.md index 58dcd82c..a168f9d0 100644 --- a/devel/README.md +++ b/devel/README.md @@ -69,4 +69,11 @@ Access the service through the GUI: directly through the API: [https://prod.foo.redhat.com:1337/docs/api/image-builder](https://prod.foo.redhat.com:1337/docs/api/image-builder). +The metrics containers are only launched when explicitly required. The command for this is below: + +```bash +docker-compose --profile metrics up +``` + Access the Grafana dashboard on [https://localhost:3000](https://localhost:3000). The default username is `admin` and the password is set to `foobar`. +The prometheus instance can be accessed on [https://localhost:9000](https://localhost:9000) diff --git a/devel/config/composer/osbuild-composer.toml b/devel/config/composer/osbuild-composer.toml index 1fbd5ff7..ce12276a 100644 --- a/devel/config/composer/osbuild-composer.toml +++ b/devel/config/composer/osbuild-composer.toml @@ -3,14 +3,18 @@ request_job_timeout = "40s" allowed_domains = [ "localhost", "worker.osbuild.org" ] enable_mtls = false enable_jwt = true -jwt_keys_url = "http://fauxauth:8888/certs" +jwt_keys_urls = ["http://fauxauth:8888/certs"] jwt_acl_file = "/etc/osbuild-composer/acl.yml" +jwt_tenant_provider_fields = ["rh-org-id"] ca = "/etc/osbuild-composer/ca-crt.pem" +client_id = "rhsm-api" [koji] allowed_domains = [ "client.osbuild.org" ] enable_mtls = false enable_jwt = true -jwt_keys_url = "http://fauxauth:8888/certs" +jwt_keys_urls = ["http://fauxauth:8888/certs"] jwt_acl_file = "/etc/osbuild-composer/acl.yml" +jwt_tenant_provider_fields = ["rh-org-id"] ca = "/etc/osbuild-composer/ca-crt.pem" +client_id = "rhsm-api" diff --git a/devel/config/worker/osbuild-worker.toml b/devel/config/worker/osbuild-worker.toml index 5ecf5a29..f69ae454 100644 --- a/devel/config/worker/osbuild-worker.toml +++ b/devel/config/worker/osbuild-worker.toml @@ -1,3 +1,4 @@ [authentication] -oauth_url = "http://fauxauth:8888/token" -offline_token = "/etc/osbuild-worker/token" +oauth_url = "http://fauxauth:8888/token?refresh_token=42" +client_secret = "/etc/osbuild-worker/secret" +client_id = "rhsm-api" diff --git a/devel/config/worker/secret b/devel/config/worker/secret new file mode 100644 index 00000000..602dc891 --- /dev/null +++ b/devel/config/worker/secret @@ -0,0 +1 @@ +supersecretsecretsquirrel diff --git a/devel/config/worker/token b/devel/config/worker/token deleted file mode 100644 index e3e73c2a..00000000 --- a/devel/config/worker/token +++ /dev/null @@ -1 +0,0 @@ -someOfflineToken diff --git a/devel/docker-compose.yml b/devel/docker-compose.yml index 346b9e5f..125eab6e 100644 --- a/devel/docker-compose.yml +++ b/devel/docker-compose.yml @@ -26,7 +26,7 @@ services: volumes: - ${CERT_DIR}/ca-crt.pem:/etc/osbuild-composer/ca-crt.pem:z - ${WORKER_CONFIG_DIR}/osbuild-worker.toml:/etc/osbuild-worker/osbuild-worker.toml:z - - ${WORKER_CONFIG_DIR}/token:/etc/osbuild-worker/token:z + - ${WORKER_CONFIG_DIR}/secret:/etc/osbuild-worker/secret:z environment: - CACHE_DIRECTORY=/var/cache/osbuild-composer privileged: true @@ -80,8 +80,9 @@ services: - PGUSER=postgres - PGPASSWORD=postgres - COMPOSER_URL=https://composer:8080 - - COMPOSER_TOKEN_URL=http://fauxauth:8888/token - - COMPOSER_OFFLINE_TOKEN=${COMPOSER_OFFLINE_TOKEN} + - COMPOSER_TOKEN_URL=http://fauxauth:8888/token?refresh_token=42 + - COMPOSER_CLIENT_SECRET=${COMPOSER_CLIENT_SECRET} + - COMPOSER_CLIENT_ID=${COMPOSER_CLIENT_ID} - COMPOSER_CA_PATH=/etc/image-builder/ca-crt.pem - DISTRIBUTIONS_DIR=/app/distributions - QUOTA_FILE=/config/quotas.json @@ -124,6 +125,7 @@ services: - "backend" - "frontend" prometheus: + profiles: ["metrics"] image: prom/prometheus:latest ports: - "9000:9090" @@ -139,6 +141,7 @@ services: command: - "--config.file=/config/prometheus.yml" grafana: + profiles: ["metrics"] image: grafana/grafana:latest ports: - "3000:3000" diff --git a/distribution/Dockerfile b/distribution/Dockerfile index 2a2767e0..5642eee1 100644 --- a/distribution/Dockerfile +++ b/distribution/Dockerfile @@ -9,4 +9,4 @@ RUN npm install COPY . . EXPOSE 8002 -CMD [ "npm", "run", "start:beta" ] +CMD [ "npm", "run", "prod-beta" ]