diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d465d23..249e03f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -62,7 +62,7 @@ jobs: with: disableTelemetry: true containerAppName: pactasrv-dev - containerAppEnvironment: pactasrv-dev + containerAppEnvironment: pacta-dev resourceGroup: rmi-pacta-dev imageToDeploy: rmipacta.azurecr.io/pacta:dev location: centalus diff --git a/azure/aztask/aztask.go b/azure/aztask/aztask.go index 18a620d..a5e0fa7 100644 --- a/azure/aztask/aztask.go +++ b/azure/aztask/aztask.go @@ -208,6 +208,7 @@ func (r *Runner) StartRun(ctx context.Context, req *task.StartRunRequest) (task. Value: to.Ptr(string(req.PortfolioID)), }, }, + // TODO: Take in the image digest as part of the task definition, as this can change per request. Image: to.Ptr(r.cfg.Image.WithTag("latest")), Name: to.Ptr(name), Probes: []*armappcontainers.ContainerAppProbe{}, diff --git a/cmd/server/configs/local.conf b/cmd/server/configs/local.conf index e1e7531..2b13a54 100644 --- a/cmd/server/configs/local.conf +++ b/cmd/server/configs/local.conf @@ -11,3 +11,13 @@ secret_postgres_password UNUSED # In non-local environments, these are passed in by Azure's secret handling infra secret_auth_public_key_id 2023-08-11 secret_auth_public_key_data -----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAP/Sv7H5TRozqXeQ2zV9W4V6Zkb/U5XWEjCQbOwAl0nc=\n-----END PUBLIC KEY----- + +secret_runner_config_location centralus +secret_runner_config_config_path /configs/local.conf +secret_runner_config_identity_name pacta-runner-local +secret_runner_config_identity_subscription_id 69b6db12-37e3-4e1f-b48c-aa41dba612a9 +secret_runner_config_identity_resource_group rmi-pacta-local +secret_runner_config_identity_client_id c02b7346-6ba6-438a-8136-1ccb608e5449 +secret_runner_config_identity_managed_environment pacta-local +secret_runner_config_image_registry rmipacta.azurecr.io +secret_runner_config_image_name runner diff --git a/scripts/run_server.sh b/scripts/run_server.sh index a84e6be..9cb1240 100755 --- a/scripts/run_server.sh +++ b/scripts/run_server.sh @@ -4,6 +4,36 @@ set -euo pipefail ROOT="$BUILD_WORKSPACE_DIRECTORY" cd "$ROOT" +# We keep it around because we'll need it at some point, but it can't be empty. +VALID_FLAGS=( + "unused" +) + +VALID_FLAGS_NO_ARGS=( + "use_azure_runner" +) + +# This argument-parsing monstrosity brought to you by some random GitHub Gist: +# https://gist.github.com/magnetikonline/22c1eb412daa350eeceee76c97519da8 +OPTS=$(getopt \ + --longoptions "$(printf "%s:," "${VALID_FLAGS[@]}")" \ + --longoptions "$(printf "%s," "${VALID_FLAGS_NO_ARGS[@]}")" \ + --name "$(basename "$0")" \ + --options "" \ + -- "$@" +) + +eval set --$OPTS +declare -a FLAGS=() +while [ ! $# -eq 0 ] +do + case "$1" in + --use_azure_runner) + FLAGS+=("--use_azure_runner") + ;; + esac + shift +done PG_LOCAL_DATA="$ROOT/.postgres-data" PG_PROPS_FILE="$PG_LOCAL_DATA/db.properties" @@ -18,7 +48,7 @@ LOCAL_DSN+=" host=$(get_val "SOCKET_DIR")" LOCAL_DSN+=" dbname=$(get_val "PG_DB_NAME")" LOCAL_DSN+=" sslmode=disable" -declare -a FLAGS=( +FLAGS+=( "--config=${ROOT}/cmd/server/configs/local.conf" "--local_dsn=${LOCAL_DSN}" )