Skip to content

Commit 189e0a8

Browse files
authored
Merge pull request #454 from unity-sds/453-smce-deployment
453 smce deployment
2 parents d049e8c + e3e4968 commit 189e0a8

File tree

47 files changed

+295
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+295
-457
lines changed

airflow/config/webserver_config.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

airflow/dags/cwl_dag_modular.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@
2525
from airflow.utils.trigger_rule import TriggerRule
2626
from kubernetes.client import models as k8s
2727
from unity_sps_utils import (
28-
CS_SHARED_SERVICES_ACCOUNT_ID,
29-
CS_SHARED_SERVICES_ACCOUNT_REGION,
3028
DEFAULT_LOG_LEVEL,
31-
DS_COGNITO_CLIENT_ID,
3229
DS_S3_BUCKET_PARAM,
3330
EC2_TYPES,
3431
LOG_LEVEL_TYPE,
32+
MDPS_CLIENT_ID,
3533
NODE_POOL_DEFAULT,
3634
NODE_POOL_HIGH_WORKLOAD,
3735
POD_LABEL,
@@ -175,16 +173,9 @@ def select_stage_in(ti, stac_json, unity_stac_auth_type):
175173
"""Retrieve stage in arguments based on authentication type parameter."""
176174
stage_in_args = {"stac_json": stac_json, "stac_auth_type": "NONE"}
177175
if unity_stac_auth_type:
178-
shared_services_account = SSM_CLIENT.get_parameter(
179-
Name=CS_SHARED_SERVICES_ACCOUNT_ID, WithDecryption=True
180-
)["Parameter"]["Value"]
181-
shared_services_region = SSM_CLIENT.get_parameter(
182-
Name=CS_SHARED_SERVICES_ACCOUNT_REGION, WithDecryption=True
183-
)["Parameter"]["Value"]
184-
unity_client_id = SSM_CLIENT.get_parameter(
185-
Name=f"arn:aws:ssm:{shared_services_region}:{shared_services_account}:parameter{DS_COGNITO_CLIENT_ID}",
186-
WithDecryption=True,
187-
)["Parameter"]["Value"]
176+
unity_client_id = SSM_CLIENT.get_parameter(Name=MDPS_CLIENT_ID, WithDecryption=True)["Parameter"][
177+
"Value"
178+
]
188179
stage_in_args["unity_client_id"] = unity_client_id
189180
stage_in_args["stac_auth_type"] = "UNITY"
190181

airflow/dags/run_ogc_process.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
from kubernetes.client import models as k8s
2020
from unity_sps_utils import POD_LABEL, POD_NAMESPACE, get_affinity
2121

22-
PROCESSES_ENDPOINT = "https://api.dit.maap-project.org/api/ogc/processes"
22+
API_HOST = "https://api.dit.maap-project.org/api/"
2323

2424

2525
def fetch_ogc_processes():
2626
"""Fetch available processes from the OGC API and create mapping."""
2727
try:
28-
response = requests.get(PROCESSES_ENDPOINT, timeout=30)
28+
response = requests.get(API_HOST + "ogc/processes", timeout=30)
2929
response.raise_for_status()
3030

3131
processes_data = response.json()
@@ -65,7 +65,8 @@ def fetch_ogc_processes():
6565

6666
# Constants
6767
K8S_SECRET_NAME = "sps-app-credentials"
68-
DOCKER_IMAGE = "jplmdps/ogc-job-runner:latest"
68+
# This docker image is generated by the files in docker/run_ogc_process
69+
DOCKER_IMAGE = "jplmdps/ogc-job-runner:v1.0.0"
6970
PROCESS_MAPPING, DROPDOWN_OPTIONS = fetch_ogc_processes()
7071

7172
# SPS-specific secrets
@@ -155,7 +156,7 @@ def _build_submit_env_vars(self):
155156
return [
156157
k8s.V1EnvVar(
157158
name="SUBMIT_JOB_URL",
158-
value="https://api.dit.maap-project.org/api/ogc/processes/{process_id}/execution",
159+
value=API_HOST + "ogc/processes/{process_id}/execution",
159160
),
160161
k8s.V1EnvVar(name="PROCESS_ID", value=str(numerical_process_id)),
161162
k8s.V1EnvVar(name="JOB_INPUTS", value=self.job_inputs or "{}"),
@@ -168,7 +169,7 @@ def _build_monitor_env_vars(self):
168169
return [
169170
k8s.V1EnvVar(
170171
name="MONITOR_JOB_URL",
171-
value="https://api.dit.maap-project.org/api/ogc/jobs/{job_id}",
172+
value=API_HOST + "ogc/jobs/{job_id}",
172173
),
173174
k8s.V1EnvVar(name="JOB_ID", value=self.job_id),
174175
k8s.V1EnvVar(name="SUBMIT_JOB", value="false"),

airflow/docker/run_ogc_process/run_ogc_process_entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ "$SUBMIT_JOB" = "true" ] || [ "$SUBMIT_JOB" = "True" ]; then
1919
--data "${SUBMIT_JOB_ARGUMENTS}")
2020

2121
echo "API Response: $response"
22-
job_id=$(echo "$response" | jq -r .id)
22+
job_id=$(echo "$response" | jq -r .jobID)
2323

2424
if [ "$job_id" = "null" ] || [ -z "$job_id" ]; then
2525
echo "Failed to get jobID from response."

airflow/helm/values.tmpl.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ webserverSecretKeySecretName: ${webserver_secret_name}
165165
webserver:
166166
replicas: 3
167167

168-
# Issue 404: DISABLE AIRRLOW AUTHENTICATION (https://github.com/unity-sds/unity-sps/issues/404)
169-
webserverConfig: |-
170-
${webserver_config}
171-
172168
startupProbe:
173169
timeoutSeconds: 20
174170
failureThreshold: 60 # Number of tries before giving up (10 minutes with periodSeconds of 10)

airflow/helm/values_high_load.tmpl.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ webserverSecretKeySecretName: ${webserver_secret_name}
165165
webserver:
166166
replicas: 3
167167

168-
# Issue 404: DISABLE AIRRLOW AUTHENTICATION (https://github.com/unity-sds/unity-sps/issues/404)
169-
webserverConfig: |-
170-
${webserver_config}
171-
172168
startupProbe:
173169
timeoutSeconds: 20
174170
failureThreshold: 60 # Number of tries before giving up (10 minutes with periodSeconds of 10)

airflow/plugins/unity_sps_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
CS_SHARED_SERVICES_ACCOUNT_ID = "/unity/shared-services/aws/account"
2222
CS_SHARED_SERVICES_ACCOUNT_REGION = "/unity/shared-services/aws/account/region"
23-
DS_COGNITO_CLIENT_ID = "/unity/shared-services/dapa/client-id"
24-
DS_S3_BUCKET_PARAM = f"/unity/unity/{os.environ['AIRFLOW_VAR_UNITY_VENUE']}/ds/datastore-bucket"
23+
MDPS_CLIENT_ID = "/sps/processing/workflows/unity_client_id"
24+
DS_S3_BUCKET_PARAM = f"/smce/mdps/{os.environ['AIRFLOW_VAR_UNITY_VENUE']}/ds/datastore-bucket"
2525

2626
DEFAULT_LOG_LEVEL = "INFO"
2727
LOG_LEVEL_TYPE = {"DEBUG": 10, "INFO": 20, "WARNING": 30, "ERROR": 40, "CRITICAL": 50}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "unity-sps"
7-
version = "3.1.0"
7+
version = "3.1.1"
88
authors = [
99
{ name = "Luca Cinquini", email = "luca.cinquini@jpl.nasa.gov" },
1010
{ name = "Grace Llewellyn", email = "grace.llewellyn@jpl.nasa.gov" },

terraform-unity/.terraform.lock.hcl

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform-unity/README.md

Lines changed: 7 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)