Commit ad7540a8 authored by Diego Molteni's avatar Diego Molteni
Browse files

fix: merge branch 'master' into slb/dm3/crv-server

parents 7532f16b d3eeb134
Pipeline #84702 canceled with stages
in 9 minutes and 31 seconds
......@@ -7,9 +7,12 @@ include:
# gcp
- local: "devops/osdu/cloud-providers/gcp.yml"
# common gcp pipeline
- local: "devops/osdu/cloud-providers/gcp-common-pipeline.yml"
# app
# sdms
- local: "app/sdms/.gitlab-ci.yml"
# file metadata service
- local: "app/filemetadata/.gitlab-ci.yml"
\ No newline at end of file
- local: "app/filemetadata/.gitlab-ci.yml"
variables:
FILEMETADATA_OSDU_GCP_HELM_PACKAGE_CHARTS: "app/filemetadata/devops/gcp/deploy app/filemetadata/devops/gcp/configmap"
FILEMETADATA_OSDU_GCP_SERVICE: seismic-store-filemetadata
FILEMETADATA_OSDU_GCP_HELM_CONFIG_SERVICE: seismic-store-filemetadata-configmap
FILEMETADATA_OSDU_GCP_HELM_CONFIG_DIR: "app/filemetadata/devops/gcp/configmap"
FILEMETADATA_OSDU_GCP_HELM_DEPLOYMENT_SERVICE: seismic-store-filemetadata-deploy
FILEMETADATA_OSDU_GCP_HELM_DEPLOYMENT_DIR: "app/filemetadata/devops/gcp/deploy"
FILEMETADATA_OSDU_GCP_HELM_CONFIG_SERVICE_VARS: "--set data.domain=$DOMAIN"
FILEMETADATA_OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS: "--set data.image=$CI_REGISTRY_IMAGE/osdu-gcp-filemetadata:$CI_COMMIT_SHORT_SHA"
.common: &common
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- gcloud config set project $OSDU_GCP_PROJECT
- gcloud container clusters get-credentials $OSDU_GCP_CLUSTER --zone $OSDU_GCP_ZONE --project $OSDU_GCP_PROJECT
- curl https://get.helm.sh/helm-v3.5.4-linux-amd64.tar.gz -s -o helm.tgz; tar -zxf helm.tgz; mv linux-amd64/helm /usr/local/bin/
filemetadata_osdu-gcp-helm-charts:
stage: build
tags: ['osdu-small']
image:
name: alpine/helm:3.5.4
entrypoint: [""]
artifacts:
paths:
- helm-charts
script:
- mkdir -p helm-charts
- helm package $FILEMETADATA_OSDU_GCP_HELM_PACKAGE_CHARTS --destination helm-charts
- helm repo index --url "${CI_SERVER_URL}/${CI_PROJECT_PATH}/-/jobs/${CI_JOB_ID}/artifacts/raw" .
- mv index.yaml helm-charts
filemetadata-osdu-gcp-helm-charts:
variables:
SEISMIC_OSDU_GCP_HELM_PACKAGE_CHARTS: "app/filemetadata/devops/gcp/deploy app/filemetadata/devops/gcp/configmap"
extends: .osdu-gcp-helm-charts
only:
variables:
- $GCP == 'true'
- $OSDU_GCP == 'true'
- $OSDU_GCP_HELM_PACKAGE_CHARTS
changes:
- devops/**/*
- app/filemetadata/**/*
refs:
- branches
- main
- merge_requests
filemetadata_osdu-gcp-containerize-gitlab:
stage: containerize
tags: ["osdu-medium"]
extends: .osdu-gcp-variables
image: docker:19.03
cache: {}
allow_failure: true
script:
filemetadata-osdu-gcp-containerize-gitlab:
variables:
SEISMIC_OSDU_GCP_DOCKERFILE_NAME: "Dockerfile"
SEISMIC_OSDU_GCP_SERVICE: seismic-store-filemetadata
extends: .osdu-gcp-containerize-gitlab
before_script:
- cd app/$FILEMETADATA_SERVICE
- export EXTRA_DOCKER_TAG=""; if [ "$CI_COMMIT_TAG" != "" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/osdu-gcp-filemetadata:$CI_COMMIT_TAG" ; elif [ "$CI_COMMIT_REF_NAME" = "master" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/osdu-gcp-filemetadata:latest" ; fi
- docker build -t $CI_REGISTRY_IMAGE/osdu-gcp-filemetadata:$CI_COMMIT_SHORT_SHA $EXTRA_DOCKER_TAG --file Dockerfile .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE/osdu-gcp-filemetadata
only:
variables:
- $OSDU_GCP == 'true'
changes:
- devops/**/*
- app/filemetadata/**/*
refs:
- branches
- main
- merge_requests
filemetadata_osdu-gcp-deploy-configmap:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
script:
- *common
- >
helm upgrade $FILEMETADATA_OSDU_GCP_HELM_CONFIG_SERVICE $FILEMETADATA_OSDU_GCP_HELM_CONFIG_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_HELM_NAMESPACE
--wait
--history-max=3
$FILEMETADATA_OSDU_GCP_HELM_CONFIG_SERVICE_VARS
filemetadata-osdu-gcp-deploy-configmap:
variables:
SEISMIC_OSDU_GCP_HELM_CONFIG_SERVICE: seismic-store-filemetadata-configmap
SEISMIC_OSDU_GCP_HELM_CONFIG_DIR: "app/filemetadata/devops/gcp/configmap"
SEISMIC_OSDU_GCP_HELM_CONFIG_SERVICE_VARS: "--set data.domain=$DOMAIN"
extends: .osdu-gcp-deploy-configmap
only:
variables:
- $OSDU_GCP == 'true'
changes:
- devops/**/*
- app/filemetadata/**/*
refs:
- branches
- main
- merge_requests
filemetadata_osdu-gcp-deployment:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
needs: ["filemetadata_osdu-gcp-containerize-gitlab", "filemetadata_osdu-gcp-deploy-configmap"]
stage: deploy
cache: {}
script:
- *common
- >
helm upgrade $FILEMETADATA_OSDU_GCP_HELM_DEPLOYMENT_SERVICE $FILEMETADATA_OSDU_GCP_HELM_DEPLOYMENT_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_HELM_NAMESPACE
--wait
--history-max=3
$FILEMETADATA_OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS
- echo ----- Verify Deployment -----
- kubectl rollout status deployment.v1.apps/$FILEMETADATA_OSDU_GCP_SERVICE -n $OSDU_GCP_HELM_NAMESPACE --timeout=900s
- POD=$(kubectl get pod --sort-by=.metadata.creationTimestamp -n $OSDU_GCP_HELM_NAMESPACE | grep $FILEMETADATA_OSDU_GCP_SERVICE | tail -1 | awk '{print $1}')
- STATUS=$(kubectl wait -n $OSDU_GCP_HELM_NAMESPACE --for=condition=Ready pod/$POD --timeout=300s)
- echo $STATUS
- if [[ "$STATUS" != *"met"* ]]; then echo "POD didn't start correctly" ; exit 1 ; fi
filemetadata-osdu-gcp-deployment:
variables:
SEISMIC_OSDU_GCP_HELM_DEPLOYMENT_SERVICE: seismic-store-filemetadata-deploy
SEISMIC_OSDU_GCP_HELM_DEPLOYMENT_DIR: "app/filemetadata/devops/gcp/deploy"
SEISMIC_OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS: "--set data.image=$CI_REGISTRY_IMAGE/osdu-gcp-$SEISMIC_OSDU_GCP_SERVICE:$CI_COMMIT_SHORT_SHA"
SEISMIC_OSDU_GCP_SERVICE: seismic-store-filemetadata
extends: .osdu-gcp-deployment
needs: ["filemetadata-osdu-gcp-containerize-gitlab", "filemetadata-osdu-gcp-deploy-configmap"]
only:
variables:
- $OSDU_GCP == 'true'
changes:
- devops/**/*
- app/filemetadata/**/*
refs:
- branches
- main
- merge_requests
\ No newline at end of file
# 3rd-Party Software License Notice
Generated by fossa-cli (https://github.com/fossas/fossa-cli).
This software includes the following software and licenses:
......@@ -93,6 +94,7 @@ BSD-2-Clause
========================================================================
The following software have components provided under the terms of this license:
- @mapbox/node-pre-gyp (from https://www.npmjs.com/package/@mapbox/node-pre-gyp)
- @mapbox/node-pre-gyp (from https://www.npmjs.com/package/@mapbox/node-pre-gyp)
- ajv (from https://www.npmjs.com/package/ajv)
- async-listener (from https://www.npmjs.com/package/async-listener)
......@@ -104,6 +106,7 @@ The following software have components provided under the terms of this license:
- dotenv (from https://www.npmjs.com/package/dotenv)
- dotenv (from https://www.npmjs.com/package/dotenv)
- emitter-listener (from https://www.npmjs.com/package/emitter-listener)
- esprima (from https://www.npmjs.com/package/esprima)
- ieee754 (from https://www.npmjs.com/package/ieee754)
- node-forge (from https://www.npmjs.com/package/node-forge)
- protobufjs (from https://www.npmjs.com/package/protobufjs)
......@@ -125,6 +128,7 @@ BSD-3-Clause
========================================================================
The following software have components provided under the terms of this license:
- @mapbox/node-pre-gyp (from https://www.npmjs.com/package/@mapbox/node-pre-gyp)
- @mapbox/node-pre-gyp (from https://www.npmjs.com/package/@mapbox/node-pre-gyp)
- @protobufjs/aspromise (from https://www.npmjs.com/package/@protobufjs/aspromise)
- @protobufjs/base64 (from https://www.npmjs.com/package/@protobufjs/base64)
......@@ -146,9 +150,12 @@ The following software have components provided under the terms of this license:
- continuation-local-storage (from https://www.npmjs.com/package/continuation-local-storage)
- cryptography (from https://github.com/pyca/cryptography)
- docutils (from http://docutils.sourceforge.net/)
- esprima (from https://www.npmjs.com/package/esprima)
- google-gax (from https://www.npmjs.com/package/google-gax)
- graphlib (from https://www.npmjs.com/package/graphlib)
- idna (from https://github.com/kjd/idna)
- ieee754 (from https://www.npmjs.com/package/ieee754)
- json-refs (from https://www.npmjs.com/package/json-refs)
- json-schema (from )
- node-forge (from https://www.npmjs.com/package/node-forge)
- protobufjs (from https://www.npmjs.com/package/protobufjs)
......@@ -161,7 +168,6 @@ The following software have components provided under the terms of this license:
- stack-chain (from https://www.npmjs.com/package/stack-chain)
- tough-cookie (from https://www.npmjs.com/package/tough-cookie)
- tough-cookie (from https://www.npmjs.com/package/tough-cookie)
- uri-js (from https://www.npmjs.com/package/uri-js)
- url-template (from https://www.npmjs.com/package/url-template)
- uuid (from https://www.npmjs.com/package/uuid)
- uuid (from https://www.npmjs.com/package/uuid)
......@@ -216,6 +222,7 @@ The following software have components provided under the terms of this license:
- abbrev (from https://www.npmjs.com/package/abbrev)
- aproba (from https://www.npmjs.com/package/aproba)
- are-we-there-yet (from https://www.npmjs.com/package/are-we-there-yet)
- are-we-there-yet (from https://www.npmjs.com/package/are-we-there-yet)
- chownr (from https://www.npmjs.com/package/chownr)
- cliui (from https://www.npmjs.com/package/cliui)
- color-support (from https://www.npmjs.com/package/color-support)
......@@ -224,6 +231,7 @@ The following software have components provided under the terms of this license:
- fs-minipass (from https://www.npmjs.com/package/fs-minipass)
- fs.realpath (from https://github.com/isaacs/fs.realpath#readme)
- gauge (from https://www.npmjs.com/package/gauge)
- gauge (from https://www.npmjs.com/package/gauge)
- get-caller-file (from https://www.npmjs.com/package/get-caller-file)
- glob (from https://www.npmjs.com/package/glob)
- glob (from https://www.npmjs.com/package/glob)
......@@ -332,6 +340,7 @@ The following software have components provided under the terms of this license:
- @types/express-serve-static-core (from https://www.npmjs.com/package/@types/express-serve-static-core)
- @types/express-unless (from https://www.npmjs.com/package/@types/express-unless)
- @types/ioredis (from https://www.npmjs.com/package/@types/ioredis)
- @types/js-yaml (from https://www.npmjs.com/package/@types/js-yaml)
- @types/long (from https://www.npmjs.com/package/@types/long)
- @types/mime (from https://www.npmjs.com/package/@types/mime)
- @types/node (from https://www.npmjs.com/package/@types/node)
......@@ -345,6 +354,7 @@ The following software have components provided under the terms of this license:
- @types/tough-cookie (from https://www.npmjs.com/package/@types/tough-cookie)
- @types/tunnel (from https://www.npmjs.com/package/@types/tunnel)
- @types/tunnel (from https://www.npmjs.com/package/@types/tunnel)
- @types/yamljs (from https://www.npmjs.com/package/@types/yamljs)
- PyJWT (from http://github.com/jpadilla/pyjwt)
- abbrev (from https://www.npmjs.com/package/abbrev)
- abort-controller (from https://www.npmjs.com/package/abort-controller)
......@@ -352,6 +362,9 @@ The following software have components provided under the terms of this license:
- adal (from https://github.com/AzureAD/azure-activedirectory-library-for-python)
- agent-base (from https://www.npmjs.com/package/agent-base)
- ajv (from https://www.npmjs.com/package/ajv)
- ajv (from https://www.npmjs.com/package/ajv)
- ajv-errors (from https://www.npmjs.com/package/ajv-errors)
- ajv-formats (from https://www.npmjs.com/package/ajv-formats)
- ansi-regex (from https://www.npmjs.com/package/ansi-regex)
- ansi-regex (from https://www.npmjs.com/package/ansi-regex)
- ansi-styles (from https://www.npmjs.com/package/ansi-styles)
......@@ -359,6 +372,7 @@ The following software have components provided under the terms of this license:
- applicationinsights-native-metrics (from https://www.npmjs.com/package/applicationinsights-native-metrics)
- aproba (from https://www.npmjs.com/package/aproba)
- are-we-there-yet (from https://www.npmjs.com/package/are-we-there-yet)
- are-we-there-yet (from https://www.npmjs.com/package/are-we-there-yet)
- argparse (from https://www.npmjs.com/package/argparse)
- array-flatten (from https://www.npmjs.com/package/array-flatten)
- arrify (from https://www.npmjs.com/package/arrify)
......@@ -403,6 +417,8 @@ The following software have components provided under the terms of this license:
- colors (from https://www.npmjs.com/package/colors)
- colorspace (from https://www.npmjs.com/package/colorspace)
- combined-stream (from https://www.npmjs.com/package/combined-stream)
- commander (from https://www.npmjs.com/package/commander)
- component-emitter (from https://www.npmjs.com/package/component-emitter)
- compressible (from https://www.npmjs.com/package/compressible)
- concat-map (from https://github.com/substack/node-concat-map)
- concat-stream (from https://www.npmjs.com/package/concat-stream)
......@@ -413,6 +429,7 @@ The following software have components provided under the terms of this license:
- content-type (from https://www.npmjs.com/package/content-type)
- cookie (from https://www.npmjs.com/package/cookie)
- cookie-signature (from https://www.npmjs.com/package/cookie-signature)
- cookiejar (from https://www.npmjs.com/package/cookiejar)
- copyfiles (from https://www.npmjs.com/package/copyfiles)
- core-util-is (from https://www.npmjs.com/package/core-util-is)
- cors (from https://www.npmjs.com/package/cors)
......@@ -476,6 +493,7 @@ The following software have components provided under the terms of this license:
- form-data (from https://www.npmjs.com/package/form-data)
- form-data (from https://www.npmjs.com/package/form-data)
- form-data (from https://www.npmjs.com/package/form-data)
- formidable (from https://www.npmjs.com/package/formidable)
- forwarded (from https://www.npmjs.com/package/forwarded)
- fresh (from https://www.npmjs.com/package/fresh)
- fs-extra (from https://www.npmjs.com/package/fs-extra)
......@@ -483,6 +501,7 @@ The following software have components provided under the terms of this license:
- fs.realpath (from https://github.com/isaacs/fs.realpath#readme)
- function-bind (from https://www.npmjs.com/package/function-bind)
- gauge (from https://www.npmjs.com/package/gauge)
- gauge (from https://www.npmjs.com/package/gauge)
- gcp-metadata (from https://www.npmjs.com/package/gcp-metadata)
- gcs-resumable-upload (from https://www.npmjs.com/package/gcs-resumable-upload)
- get-caller-file (from https://www.npmjs.com/package/get-caller-file)
......@@ -495,6 +514,7 @@ The following software have components provided under the terms of this license:
- glob (from https://www.npmjs.com/package/glob)
- google-p12-pem (from https://www.npmjs.com/package/google-p12-pem)
- graceful-fs (from https://www.npmjs.com/package/graceful-fs)
- graphlib (from https://www.npmjs.com/package/graphlib)
- gtoken (from https://www.npmjs.com/package/gtoken)
- har-schema (from https://www.npmjs.com/package/har-schema)
- har-validator (from https://www.npmjs.com/package/har-validator)
......@@ -547,13 +567,17 @@ The following software have components provided under the terms of this license:
- isarray (from https://www.npmjs.com/package/isarray)
- isarray (from https://www.npmjs.com/package/isarray)
- isstream (from https://github.com/rvagg/isstream)
- jmespath (from https://github.com/jmespath/jmespath.py)
- jmespath (from https://www.npmjs.com/package/jmespath)
- jmespath (from https://github.com/jmespath/jmespath.py)
- js-sha256 (from https://www.npmjs.com/package/js-sha256)
- js-yaml (from https://www.npmjs.com/package/js-yaml)
- js-yaml (from https://www.npmjs.com/package/js-yaml)
- jsbn (from https://www.npmjs.com/package/jsbn)
- json-bigint (from https://www.npmjs.com/package/json-bigint)
- json-refs (from https://www.npmjs.com/package/json-refs)
- json-schema (from )
- json-schema-traverse (from https://www.npmjs.com/package/json-schema-traverse)
- json-schema-traverse (from https://www.npmjs.com/package/json-schema-traverse)
- json-stringify-safe (from https://www.npmjs.com/package/json-stringify-safe)
- jsonfile (from https://www.npmjs.com/package/jsonfile)
- jsonwebtoken (from https://www.npmjs.com/package/jsonwebtoken)
......@@ -610,11 +634,11 @@ The following software have components provided under the terms of this license:
- ms (from https://www.npmjs.com/package/ms)
- ms (from https://www.npmjs.com/package/ms)
- nan (from https://www.npmjs.com/package/nan)
- native-promise-only (from http://github.com/getify/native-promise-only)
- negotiator (from https://www.npmjs.com/package/negotiator)
- node-abort-controller (from https://www.npmjs.com/package/node-abort-controller)
- node-fetch (from https://www.npmjs.com/package/node-fetch)
- node-fetch (from https://www.npmjs.com/package/node-fetch)
- node-fetch (from https://www.npmjs.com/package/node-fetch)
- node-forge (from https://www.npmjs.com/package/node-forge)
- nopt (from https://www.npmjs.com/package/nopt)
- npmlog (from https://www.npmjs.com/package/npmlog)
......@@ -638,6 +662,7 @@ The following software have components provided under the terms of this license:
- p-timeout (from https://www.npmjs.com/package/p-timeout)
- parseurl (from https://www.npmjs.com/package/parseurl)
- path-is-absolute (from https://www.npmjs.com/package/path-is-absolute)
- path-loader (from https://www.npmjs.com/package/path-loader)
- path-parse (from https://www.npmjs.com/package/path-parse)
- path-to-regexp (from https://www.npmjs.com/package/path-to-regexp)
- performance-now (from https://www.npmjs.com/package/performance-now)
......@@ -670,6 +695,7 @@ The following software have components provided under the terms of this license:
- request-promise (from https://www.npmjs.com/package/request-promise)
- request-promise-core (from https://www.npmjs.com/package/request-promise-core)
- require-directory (from https://github.com/troygoode/node-require-directory/)
- require-from-string (from https://www.npmjs.com/package/require-from-string)
- require-in-the-middle (from https://www.npmjs.com/package/require-in-the-middle)
- resolve (from https://www.npmjs.com/package/resolve)
- retry (from https://www.npmjs.com/package/retry)
......@@ -694,6 +720,7 @@ The following software have components provided under the terms of this license:
- signal-exit (from https://www.npmjs.com/package/signal-exit)
- simple-swizzle (from https://www.npmjs.com/package/simple-swizzle)
- six (from http://pypi.python.org/pypi/six/)
- slash (from https://www.npmjs.com/package/slash)
- snakeize (from https://www.npmjs.com/package/snakeize)
- source-map-support (from https://www.npmjs.com/package/source-map-support)
- split-array-stream (from https://www.npmjs.com/package/split-array-stream)
......@@ -719,6 +746,7 @@ The following software have components provided under the terms of this license:
- strip-ansi (from https://www.npmjs.com/package/strip-ansi)
- strip-ansi (from https://www.npmjs.com/package/strip-ansi)
- stubs (from https://www.npmjs.com/package/stubs)
- superagent (from https://www.npmjs.com/package/superagent)
- supports-color (from https://www.npmjs.com/package/supports-color)
- swagger-ui-dist (from https://www.npmjs.com/package/swagger-ui-dist)
- swagger-ui-express (from https://www.npmjs.com/package/swagger-ui-express)
......@@ -797,6 +825,7 @@ Python-2.0
========================================================================
The following software have components provided under the terms of this license:
- argparse (from https://www.npmjs.com/package/argparse)
- cryptography (from https://github.com/pyca/cryptography)
- docutils (from http://docutils.sourceforge.net/)
- python-dateutil (from https://dateutil.readthedocs.org)
......@@ -849,6 +878,4 @@ The following software have components provided under the terms of this license:
- jmespath (from https://www.npmjs.com/package/jmespath)
- protobufjs (from https://www.npmjs.com/package/protobufjs)
- querystring (from https://www.npmjs.com/package/querystring)
- sax (from https://www.npmjs.com/package/sax)
- sax (from https://www.npmjs.com/package/sax)
\ No newline at end of file
......@@ -14,8 +14,7 @@ spec:
notRequestPrincipals: ["*"]
to:
- operation:
notPaths: ["/","*/index.html",
"*/v2/api-docs",
"*/actuator/health", "*/health",
"*/configuration/ui","*/configuration/security",
"{{ .Values.configEnv.sdmsPrefix }}/swagger-ui.html*"]
notPaths: ["/",
"*/swagger-ui.html*",
"*/svcstatus",
"*/svcstatus/readiness"]
......@@ -42,7 +42,7 @@ spec:
periodSeconds: 60
readinessProbe:
httpGet:
path: {{ .Values.configEnv.sdmsPrefix }}/svcstatus
path: {{ .Values.configEnv.sdmsPrefix }}/svcstatus/readiness
port: 80
httpHeaders:
- name: X-Api-Key
......
......@@ -4,6 +4,7 @@ include:
variables:
#aws variables
AWS_SERVICE: seismic-store
AWS_SERVICE_NAMESPACE: osdu-seismic-ddms
AWS_BUILD_SUBDIR: src/cloud/providers/aws/build-aws
AWS_TEST_SUBDIR: tests
AWS_ENVIRONMENT: dev
......@@ -69,8 +70,8 @@ sdms_aws-update-eks:
- aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER_NAME --role-arn $EKS_CLUSTER_MGMT_ROLE
#Some CLIs require a restrictive KUBECONFIG file
- chmod 644 $KUBECONFIG
- kubectl -n osdu-services rollout restart deployment/${AWS_EKS_DEPLOYMENT_NAME}
- kubectl -n osdu-services rollout status -w deployment/${AWS_EKS_DEPLOYMENT_NAME} --timeout=900s
- kubectl -n ${AWS_SERVICE_NAMESPACE:-osdu-services} rollout restart deployment/${AWS_EKS_DEPLOYMENT_NAME}
- kubectl -n ${AWS_SERVICE_NAMESPACE:-osdu-services} rollout status -w deployment/${AWS_EKS_DEPLOYMENT_NAME} --timeout=900s
only:
variables:
- $AWS_SKIP_DEPLOY != 'true' && $AWS == 'true' && $AWS_DEPLOY_TARGET == 'EKS'
......@@ -93,7 +94,40 @@ sdms_aws-test-newman:
script:
- cd app/$SDMS_SERVICE
- pip3 install -r devops/aws/requirements.txt
- svctoken=$(python3 devops/scripts/aws_jwt_client.py)
- svctoken=$(python3 devops/scripts/aws_jwt_client.py)
- >
curl --insecure --location --request POST "$LEGAL_BASE_URL"'legaltags' \
--header 'accept: application/json' \
--header 'authorization: Bearer '"$svctoken" \
--header 'content-type: application/json' \
--header 'data-partition-id: opendes' \
--data '{
"name": "sdmstestlegaltag",
"description": "test legal for Seismic DMS test",
"properties": {
"countryOfOrigin":["US"],
"contractId":"A1234",
"expirationDate":"2099-01-25",
"dataType":"Public Domain Data",
"originator":"MyCompany",
"securityClassification":"Public",
"exportClassification":"EAR99",
"personalData":"No Personal Data"
}
}'
- echo 'Register SeismicStore.tenants before Integration Tests ...'
- >
curl --insecure --location --request POST "$SEISMICSTORE_SVC_URL"'/tenant/opendes' \
--header 'accept: application/json' \
--header 'authorization: Bearer '"$svctoken" \
--header 'content-type: application/json' \
--header 'data-partition-id: opendes' \
--data '{
"default_acls": "users.datalake.admins@opendes.example.com",
"esd": "opendes.example.com",
"gcpid": "aws_project_id"
}'
- npm install -g newman
- chmod +x ./tests/e2e/run_e2e_tests.sh
- ./tests/e2e/run_e2e_tests.sh --seistore-svc-url=${AWS_BASE_URL}${AWS_SDMS_PREFIX} --seistore-svc-api-key="NA" --user-idtoken="$svctoken" --user-idtoken="$svctoken" --tenant=opendes --admin-email="${AWS_COGNITO_AUTH_PARAMS_USER}" --datapartition=opendes --legaltag01=opendes-sdmstestlegaltag --legaltag02=opendes-sdmstestlegaltag --VCS-Provider="${ISGITLAB}" --subproject=awsdemosubproject
......
......@@ -13,7 +13,7 @@ variables:
SDMS_MIN_REPLICAS: 1
SDMS_MAX_REPLICAS: 5
AZURE_SDMS_PREFIX: /seistore-svc/api/v3
E2E_SUBPROJECT: demosandbox02
E2E_SUBPROJECT: demosandbox03
sdms_push_runtime_image_azure:
image: danielscholl/azure-build-image
......
variables:
SDMS_OSDU_GCP_HELM_PACKAGE_CHARTS: "app/sdms/devops/gcp/deploy app/sdms/devops/gcp/configmap"
SDMS_OSDU_GCP_SERVICE: seismic-store
SDMS_OSDU_GCP_HELM_CONFIG_SERVICE: seismic-store-configmap
SDMS_OSDU_GCP_HELM_CONFIG_DIR: "app/sdms/devops/gcp/configmap"
SDMS_OSDU_GCP_HELM_DEPLOYMENT_SERVICE: seismic-store-deploy
SDMS_OSDU_GCP_HELM_DEPLOYMENT_DIR: "app/sdms/devops/gcp/deploy"
SDMS_OSDU_GCP_HELM_CONFIG_SERVICE_VARS: "--set data.domain=$DOMAIN"
SDMS_OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS: "--set data.image=$CI_REGISTRY_IMAGE/osdu-gcp-sdms:$CI_COMMIT_SHORT_SHA"
GCP_SDMS_PREFIX: /api/seismic-store/v3
.common: &common
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- gcloud config set project $OSDU_GCP_PROJECT
- gcloud container clusters get-credentials $OSDU_GCP_CLUSTER --zone $OSDU_GCP_ZONE --project $OSDU_GCP_PROJECT
- curl https://get.helm.sh/helm-v3.5.4-linux-amd64.tar.gz -s -o helm.tgz; tar -zxf helm.tgz; mv linux-amd64/helm /usr/local/bin/
sdms_osdu-gcp-helm-charts:
stage: build
tags: ['osdu-small']
image:
name: alpine/helm:3.5.4
entrypoint: [""]
artifacts:
paths:
- helm-charts
script:
- mkdir -p helm-charts
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SDMS_OSDU_GCP_HELM_CONFIG_DIR}/values.yaml
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SDMS_OSDU_GCP_HELM_DEPLOYMENT_DIR}/values.yaml
- helm package $SDMS_OSDU_GCP_HELM_PACKAGE_CHARTS --destination helm-charts
- helm repo index --url "${CI_SERVER_URL}/${CI_PROJECT_PATH}/-/jobs/${CI_JOB_ID}/artifacts/raw" .
- mv index.yaml helm-charts
sdms-osdu-gcp-helm-charts:
variables:
SEISMIC_OSDU_GCP_HELM_PACKAGE_CHARTS: "app/sdms/devops/gcp/deploy app/sdms/devops/gcp/configmap"
SEISMIC_OSDU_GCP_HELM_CONFIG_DIR: "app/sdms/devops/gcp/configmap"
SEISMIC_OSDU_GCP_HELM_DEPLOYMENT_DIR: "app/sdms/devops/gcp/deploy"
extends: .osdu-gcp-helm-charts
before_script:
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SEISMIC_OSDU_GCP_HELM_CONFIG_DIR}/values.yaml
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SEISMIC_OSDU_GCP_HELM_DEPLOYMENT_DIR}/values.yaml
only:
variables:
- $GCP == 'true'
- $OSDU_GCP == 'true'
- $OSDU_GCP_HELM_PACKAGE_CHARTS
changes:
- devops/**/*
- app/sdms/**/*
refs:
- branches
- main
- merge_requests
sdms_osdu-gcp-containerize-gitlab:
stage: containerize
needs: ["sdms_compile-and-unit-test"]
tags: ["osdu-medium"]
extends: .osdu-gcp-variables
image: docker:19.03
cache: {}
allow_failure: true
script:
sdms-osdu-gcp-containerize-gitlab:
variables:
SEISMIC_OSDU_GCP_DOCKERFILE_NAME: "docker/runtime.Dockerfile"
SEISMIC_OSDU_GCP_SERVICE: seismic-store
extends: .osdu-gcp-containerize-gitlab
before_script:
- cd app/$SDMS_SERVICE
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ./docs/api/openapi.osdu.yaml
- export EXTRA_DOCKER_TAG=""; if [ "$CI_COMMIT_TAG" != "" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/osdu-gcp-sdms:$CI_COMMIT_TAG" ; elif [ "$CI_COMMIT_REF_NAME" = "master" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/osdu-gcp-sdms:latest" ; fi
- docker build -t $CI_REGISTRY_IMAGE/osdu-gcp-sdms:$CI_COMMIT_SHORT_SHA $EXTRA_DOCKER_TAG --file docker/runtime.Dockerfile .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE/osdu-gcp-sdms
only:
variables:
- $OSDU_GCP == 'true'
changes:
- devops/**/*
- app/sdms/**/*
refs:
- branches
- main
- merge_requests
sdms_osdu-gcp-deploy-configmap:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
needs: ["sdms_compile-and-unit-test"]
script:
- *common
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SDMS_OSDU_GCP_HELM_CONFIG_DIR}/values.yaml
- >
helm upgrade $SDMS_OSDU_GCP_HELM_CONFIG_SERVICE $SDMS_OSDU_GCP_HELM_CONFIG_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_HELM_NAMESPACE
--wait
--history-max=3
$SDMS_OSDU_GCP_HELM_CONFIG_SERVICE_VARS
sdms-osdu-gcp-deploy-configmap:
variables:
SEISMIC_OSDU_GCP_HELM_CONFIG_SERVICE: seismic-store-configmap
SEISMIC_OSDU_GCP_HELM_CONFIG_DIR: "app/sdms/devops/gcp/configmap"
SEISMIC_OSDU_GCP_HELM_CONFIG_SERVICE_VARS: "--set data.domain=$DOMAIN"
extends: .osdu-gcp-deploy-configmap
before_script:
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SEISMIC_OSDU_GCP_HELM_CONFIG_DIR}/values.yaml
only:
variables:
- $OSDU_GCP == 'true'
changes:
- devops/**/*
- app/sdms/**/*
refs:
- branches
- main
- merge_requests
sdms_osdu-gcp-deployment:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
needs: ["sdms_osdu-gcp-containerize-gitlab", "sdms_osdu-gcp-deploy-configmap"]
stage: deploy
cache: {}
script:
- *common
- sed -i 's|#{SDMS_PREFIX}#|'$GCP_SDMS_PREFIX'|' ${SDMS_OSDU_GCP_HELM_DEPLOYMENT_DIR}/values.yaml
- >
helm upgrade $SDMS_OSDU_GCP_HELM_DEPLOYMENT_SERVICE $SDMS_OSDU_GCP_HELM_DEPLOYMENT_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_HELM_NAMESPACE
--wait
--history-max=3
$SDMS_OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS
- echo ----- Verify Deployment -----
- kubectl rollout status deployment.v1.apps/$SDMS_OSDU_GCP_SERVICE -n $OSDU_GCP_HELM_NAMESPACE --timeout=900s
- POD=$(kubectl get pod --sort-by=.metadata.creationTimestamp -n $OSDU_GCP_HELM_NAMESPACE | grep $SDMS_OSDU_GCP_SERVICE | tail -1 | awk '{print $1}')
- STATUS=$(kubectl wait -n $OSDU_GCP_HELM_NAMESPACE --for=condition=Ready pod/$POD --timeout=300s)
- echo $STATUS
- if [[ "$STATUS" != *"met"* ]]; then echo "POD didn't start correctly" ; exit 1 ; fi