Skip to content

Commit

Permalink
[COST-4871] mount OCI credentials as volume (#5048)
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb authored Apr 18, 2024
1 parent 860ba12 commit a552357
Show file tree
Hide file tree
Showing 30 changed files with 407 additions and 836 deletions.
6 changes: 2 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ GCP_TABLE_ID='table_id_example'
GCP_PROJECT_ID='project_id_example'

# OCI
OCI_CLI_USER=ocid1.user.id
OCI_CLI_FINGERPRINT=00000000000000000
OCI_CLI_TENANCY=ocid1.tenancy.id
OCI_CLI_KEY_FILE=/path/to/credentials
OCI_SHARED_CREDENTIALS_FILE=/etc/credentials/oci
OCI_CLI_KEY_FILE=/etc/credentials/oci_key_file.pem

API_PATH_PREFIX='/api/cost-management'
KOKU_API_HOSTNAME=localhost
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,9 @@ endif
ifndef region
$(error param region is not set)
endif
# Required environment variables: [OCI_CLI_USER, OCI_CLI_KEY_FILE, OCI_CLI_FINGERPRINT, OCI_CLI_TENANCY]
(printenv OCI_CLI_USER > /dev/null 2>&1) || (echo 'OCI_CLI_USER is not set in .env' && exit 1)
# Required environment variables: [OCI_SHARED_CREDENTIALS_FILE, OCI_CLI_KEY_FILE]
(printenv OCI_SHARED_CREDENTIALS_FILE > /dev/null 2>&1) || (echo 'OCI_SHARED_CREDENTIALS_FILE is not set in .env' && exit 1)
(printenv OCI_CLI_KEY_FILE > /dev/null 2>&1) || (echo 'OCI_CLI_KEY_FILE is not set in .env' && exit 1)
(printenv OCI_CLI_FINGERPRINT > /dev/null 2>&1) || (echo 'OCI_CLI_FINGERPRINT is not set in .env' && exit 1)
(printenv OCI_CLI_TENANCY > /dev/null 2>&1) || (echo 'OCI_CLI_TENANCY is not set in .env' && exit 1)
curl -d '{"name": "$(oci_name)", "source_type": "OCI", "authentication": {"credentials": []}, "billing_source": {"data_source": {"bucket": "$(bucket)", "bucket_namespace": "$(namespace)", "bucket_region": "$(region)"}}}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8000/api/cost-management/v1/sources/


Expand Down
8 changes: 2 additions & 6 deletions ci/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ function run_smoke_tests_stage() {
AWS_CREDENTIALS_EPH=$(jq -r '."aws-credentials"' < aws-creds.json)
GCP_CREDENTIALS_EPH=$(jq -r '."gcp-credentials"' < gcp-creds.json)
OCI_CREDENTIALS_EPH=$(jq -r '."oci-credentials"' < oci-creds.json)
OCI_CLI_USER_EPH=$(jq -r '."oci-cli-user"' < oci-creds.json | base64 -d)
OCI_CLI_FINGERPRINT_EPH=$(jq -r '."oci-cli-fingerprint"' < oci-creds.json | base64 -d)
OCI_CLI_TENANCY_EPH=$(jq -r '."oci-cli-tenancy"' < oci-creds.json | base64 -d)
OCI_CONFIG_EPH=$(jq -r '."oci-config"' < oci-creds.json)

# This sets the image tag for the migrations Job to be the current koku image tag
DBM_IMAGE_TAG=${IMAGE_TAG}
Expand All @@ -118,9 +116,7 @@ function run_smoke_tests_stage() {
--set-parameter koku/AWS_CREDENTIALS_EPH=${AWS_CREDENTIALS_EPH} \
--set-parameter koku/GCP_CREDENTIALS_EPH=${GCP_CREDENTIALS_EPH} \
--set-parameter koku/OCI_CREDENTIALS_EPH=${OCI_CREDENTIALS_EPH} \
--set-parameter koku/OCI_CLI_USER_EPH=${OCI_CLI_USER_EPH} \
--set-parameter koku/OCI_CLI_FINGERPRINT_EPH=${OCI_CLI_FINGERPRINT_EPH} \
--set-parameter koku/OCI_CLI_TENANCY_EPH=${OCI_CLI_TENANCY_EPH} \
--set-parameter koku/OCI_CONFIG_EPH=${OCI_CONFIG_EPH} \
--set-parameter koku/DBM_IMAGE_TAG=${DBM_IMAGE_TAG} \
--set-parameter koku/DBM_INVOCATION=${DBM_INVOCATION} \
--no-single-replicas \
Expand Down
Loading

0 comments on commit a552357

Please sign in to comment.