From ba4c191e7bc5980976185f15cc61ffbb15af078a Mon Sep 17 00:00:00 2001 From: Sherman Yang <SYang@slb.com> Date: Tue, 29 Sep 2020 15:46:24 -0500 Subject: [PATCH] sync up with latest delfi updates --- README.md | 3 +- crs-converter-core/pom.xml | 14 +- .../osdu/crs/model/ConvertGeoJsonRequest.java | 5 +- .../osdu/crs/model/ConvertPointsRequest.java | 5 +- .../crs/model/ConvertTrajectoryRequest.java | 13 +- .../opengroup/osdu/crs/util/Constants.java | 3 +- devops/azure/Dockerfile | 7 + devops/azure/README.md | 17 ++ devops/azure/chart/Chart.yaml | 6 + devops/azure/chart/templates/deployment.yaml | 90 ++++++++++ devops/azure/chart/templates/service.yaml | 13 ++ devops/azure/chart/values.yaml | 17 ++ pom.xml | 25 ++- .../crs-converter-aks/Dockerfile | 16 -- .../crs-converter-aks/.helmignore | 22 --- .../crs-converter-aks/Chart.yaml | 5 - .../crs-converter-aks/templates/NOTES.txt | 21 --- .../crs-converter-aks/templates/_helpers.tpl | 32 ---- .../templates/deployment.yaml | 48 ----- .../crs-converter-aks/templates/ingress.yaml | 40 ----- .../crs-converter-aks/templates/service.yaml | 14 -- .../crs-converter-aks/values.yaml | 57 ------ .../crs-converter-aks/values.yaml.tmpl | 56 ------ .../devops/azure-pipelines.yml | 55 ------ .../crs-converter-aks/devops/stages.yml | 170 ------------------ .../external/entitlement-service.yaml | 7 - .../istio/destination-rule.yaml | 24 --- .../crs-converter-aks/istio/gateway.yaml | 28 --- .../istio/virtualservice-v2.yaml | 33 ---- .../crs-converter-aks/pom.xml | 7 +- .../opengroup/osdu/crs/CRSApplication.java | 2 - .../src/main/resources/application.yaml | 5 +- .../test_crs_converter.py | 3 +- 33 files changed, 203 insertions(+), 660 deletions(-) create mode 100644 devops/azure/Dockerfile create mode 100644 devops/azure/README.md create mode 100644 devops/azure/chart/Chart.yaml create mode 100644 devops/azure/chart/templates/deployment.yaml create mode 100644 devops/azure/chart/templates/service.yaml create mode 100644 devops/azure/chart/values.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/Dockerfile delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/.helmignore delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/Chart.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/NOTES.txt delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/_helpers.tpl delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/deployment.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/ingress.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/service.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml.tmpl delete mode 100644 provider/crs-converter-azure/crs-converter-aks/devops/azure-pipelines.yml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/devops/stages.yml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/external/entitlement-service.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/istio/destination-rule.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/istio/gateway.yaml delete mode 100644 provider/crs-converter-azure/crs-converter-aks/istio/virtualservice-v2.yaml diff --git a/README.md b/README.md index 28375682..dbbc56c6 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ mvn clean install ``` - Run application with command ```bash -java -Dclient-id=${aad_client_id} -jar provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-1.0.0.jar +java -jar provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-1.0.0.jar ``` ### Debug CRS Conversion Service locally @@ -84,4 +84,3 @@ requires the following environment variables: |----------|----------| | ENTITLEMENT_URL | Required | | ESRI_DATA_PATH | Required, e.g. /C/osdu-delfi/crs-conversion-service/ | -| client-id | Required, Azure AAD client id | diff --git a/crs-converter-core/pom.xml b/crs-converter-core/pom.xml index 084aca96..fddc29f1 100644 --- a/crs-converter-core/pom.xml +++ b/crs-converter-core/pom.xml @@ -40,11 +40,11 @@ <distributionManagement> <repository> <id>${gitlab-server}</id> - <url>https://community.opengroup.org/api/v4/projects/22/packages/maven</url> + <url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url> </repository> <snapshotRepository> <id>${gitlab-server}</id> - <url>https://community.opengroup.org/api/v4/projects/22/packages/maven</url> + <url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url> </snapshotRepository> </distributionManagement> @@ -62,7 +62,10 @@ <artifactId>jwks-rsa</artifactId> <version>0.11.0</version> </dependency> - + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-config</artifactId> + </dependency> <!-- lombok dependencies --> <dependency> <groupId>org.projectlombok</groupId> @@ -96,6 +99,11 @@ </dependency> <!-- test dependencies --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> diff --git a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertGeoJsonRequest.java b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertGeoJsonRequest.java index b224d836..26bf01eb 100644 --- a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertGeoJsonRequest.java +++ b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertGeoJsonRequest.java @@ -11,13 +11,12 @@ import javax.validation.constraints.NotEmpty; @Data @ApiModel(description = Constants.SWAGGER_GEO_JSON_CONVERT_REQUEST_DESCR) public class ConvertGeoJsonRequest { - @ApiModelProperty(value = Constants.SWAGGER_GEO_JSON_FEATURE_COLLECTION, required = true, - example = Constants.SWAGGER_GEO_JSON_FEATURE_COLLECTION_EXAMPLE) + @ApiModelProperty(value = Constants.SWAGGER_GEO_JSON_FEATURE_COLLECTION, required = true) private GeoJsonFeatureCollection featureCollection; @NotEmpty @ApiModelProperty(value = Constants.SWAGGER_TARGET_CRS, required = true, dataType = "String", - example = Constants.SWAGGER_TARGET_CRS_EXAMPLE) + example = Constants.SWAGGER_TARGET_CRS_GEO_EXAMPLE) private String toCRS; @ApiModelProperty(value = Constants.SWAGGER_TARGET_Z_UNIT, required = true, dataType = "String", diff --git a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertPointsRequest.java b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertPointsRequest.java index 2085c801..d6ff7564 100644 --- a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertPointsRequest.java +++ b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertPointsRequest.java @@ -18,11 +18,12 @@ public class ConvertPointsRequest { @NotEmpty @ApiModelProperty(value = Constants.SWAGGER_TARGET_CRS, required = true, dataType = "String", - example = Constants.SWAGGER_TARGET_CRS_EXAMPLE) + example = Constants.SWAGGER_CONVERT_TARGET_CRS_EXAMPLE) private String toCRS; @Valid @NotEmpty - @ApiModelProperty(value = Constants.SWAGGER_LIST_OF_POINTS_TO_BE_CONVERTED, required = true) + @ApiModelProperty(value = Constants.SWAGGER_LIST_OF_POINTS_TO_BE_CONVERTED, required = true, + example = Constants.SWAGGER_LIST_OF_POINTS_TO_BE_CONVERTED_EXAMPLE) private List<Point> points; } diff --git a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertTrajectoryRequest.java b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertTrajectoryRequest.java index a5a69419..85dd3b18 100644 --- a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertTrajectoryRequest.java +++ b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/model/ConvertTrajectoryRequest.java @@ -28,7 +28,7 @@ public class ConvertTrajectoryRequest { @NotEmpty @ApiModelProperty( value = Constants.SWAGGER_TRJ_REQ_CRS, required = true, dataType = "String", - example = Constants.SWAGGER_TARGET_CRS_EXAMPLE) + example = Constants.SWAGGER_TARGET_CRS_EX) private String trajectoryCRS; @JsonProperty("azimuthReference") @@ -38,17 +38,18 @@ public class ConvertTrajectoryRequest { example = Constants.SWAGGER_TRJ_REQ_AZIMUTH_REF_EXAMPLE) private String azimuthReference; + @NotEmpty @JsonProperty("unitXY") @ApiModelProperty( value = Constants.SWAGGER_TRJ_REQ_UNIT_XY, dataType = "String", - example = Constants.SWAGGER_TRJ_REQ_UNIT_EXAMPLE) + example = Constants.SWAGGER_TRJ_REQ_UNIT_XY_EXAMPLE) private String unitXY; @JsonProperty("unitZ") @NotEmpty @ApiModelProperty( value = Constants.SWAGGER_TRJ_REQ_UNIT_Z, required = true, dataType = "String", - example = Constants.SWAGGER_TRJ_REQ_UNIT_EXAMPLE) + example = Constants.SWAGGER_TRJ_REQ_UNIT_Z_EXAMPLE) private String unitZ; @JsonProperty("referencePoint") @@ -58,7 +59,8 @@ public class ConvertTrajectoryRequest { @JsonProperty("inputStations") @Valid @NotEmpty - @ApiModelProperty(value = Constants.SWAGGER_TRJ_REQ_LIST_OF_INPUT_STATIONS, required = true) + @ApiModelProperty(value = Constants.SWAGGER_TRJ_REQ_LIST_OF_INPUT_STATIONS, + example = Constants.SWAGGER_TRJ_REQ_LIST_OF_INPUT_STATIONS_EX, required = true) private List<TrajectoryStationIn> inputStations; @JsonProperty("method") @@ -75,7 +77,8 @@ public class ConvertTrajectoryRequest { private String inputKind; @JsonProperty("interpolate") - @ApiModelProperty(value=Constants.SWAGGER_TRJ_REQ_INTERPOLATE, dataType = "Boolean") + @ApiModelProperty(value=Constants.SWAGGER_TRJ_REQ_INTERPOLATE, + example = Constants.SWAGGER_TRJ_REQ_INTERPOLATE_EX, dataType = "Boolean") private boolean interpolate; @Override diff --git a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/util/Constants.java b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/util/Constants.java index 1edc5afd..55663cc1 100644 --- a/crs-converter-core/src/main/java/org/opengroup/osdu/crs/util/Constants.java +++ b/crs-converter-core/src/main/java/org/opengroup/osdu/crs/util/Constants.java @@ -50,7 +50,7 @@ public final class Constants { public static final String SWAGGER_CONVERSION_RESPONSE = "Response of a CRS conversion/transformation operation"; public static final String SWAGGER_CONVERT_AUDIT = "The list of operations performed on the points as a list of strings"; public static final String SWAGGER_TARGET_Z_UNIT = "Optional: the target Z-unit for the z-axis scaling."; - public static final String SWAGGER_TARGET_Z_UNIT_EXAMPLE = "{\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"scaleOffset\":{\"offset\":0.0,\"scale\":1.0},\"symbol\":\"m\",\"type\":\"USO\"}"; + public static final String SWAGGER_TARGET_Z_UNIT_EXAMPLE = "\"{\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"scaleOffset\":{\"offset\":0.0,\"scale\":1.0},\"symbol\":\"m\",\"type\":\"USO\"}\""; public static final String SWAGGER_GEO_JSON_CONVERT_TITLE = "Convert a GeoJSON or AnyCrsGeoJson structure"; public static final String SWAGGER_GEO_JSON_CONVERT_NOTES = "Convert a GeoJSON or AnyCrsGeoJson structure"; @@ -130,6 +130,7 @@ public final class Constants { public static final String SWAGGER_TRJ_REQ_INPUT_KIND = "The kind of input; one of MD_Inclination_Azimuth (default), MD_X_Y_Z, MD_dX_dY_dZ, X_Y_Z, dX_dY_dZ. MD stands for measured depth; MD_X_Y_Z/X_Y_Z stand for absolute coordinates in the reference CRS, MD_dX_dY_dZ/dX_dY_dZ stand for deviations relative to the reference point."; public static final String SWAGGER_TRJ_REQ_INPUT_KIND_EXAMPLE = "MD_Inclination_Azimuth"; public static final String SWAGGER_TRJ_REQ_INTERPOLATE = "Perform trajectory interpolation on demand; default is true."; + public static final String SWAGGER_TRJ_REQ_INTERPOLATE_EX = "True"; public static final String SWAGGER_TRJ_STN_IN_DESCRIPTION = "Input trajectory station record; context is provided by the container."; public static final String SWAGGER_MD = "MD (measured depth) from vertical reference point in 'unitZ'."; diff --git a/devops/azure/Dockerfile b/devops/azure/Dockerfile new file mode 100644 index 00000000..1e7b87c0 --- /dev/null +++ b/devops/azure/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:8-jdk-alpine + +COPY EsriCatalog /EsriCatalog +COPY provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-1.0.0.jar /app.jar + +ENTRYPOINT ["java","-jar","/app.jar"] + diff --git a/devops/azure/README.md b/devops/azure/README.md new file mode 100644 index 00000000..c9132e0d --- /dev/null +++ b/devops/azure/README.md @@ -0,0 +1,17 @@ +# Pipeline Support Commands + +```bash +AZURE_SERVICE="crs-conversion-service" +REPO_BRANCH="master" +TAG="latest" +PARTIAL=${REPO_BRANCH/\//-} +BRANCH=${PARTIAL/./-} + +echo "--set image.branch=$BRANCH --set image.tag=$TAG" + +# Install the Service +helm upgrade -i osdu-gitlab-$AZURE_SERVICE chart --set image.branch=$BRANCH --set image.tag=$TAG +pod=$(kubectl get pod |grep $AZURE_SERVICE | tail -1 | awk '{print $1}') +status=$(kubectl wait --for=condition=Ready pod/$pod --timeout=60s) +if [[ "$status" != *"met"* ]]; then echo "POD didn't start correctly" ; exit 1 ; fi +``` diff --git a/devops/azure/chart/Chart.yaml b/devops/azure/chart/Chart.yaml new file mode 100644 index 00000000..7a9d162b --- /dev/null +++ b/devops/azure/chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: crs-conversion-service +appVersion: "latest" +description: Helm Chart for installing crs-conversion-service service. +version: 0.1.0 +type: application diff --git a/devops/azure/chart/templates/deployment.yaml b/devops/azure/chart/templates/deployment.yaml new file mode 100644 index 00000000..1b981aee --- /dev/null +++ b/devops/azure/chart/templates/deployment.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + namespace: osdu +spec: + replicas: {{ .Values.global.replicaCount }} + selector: + matchLabels: + app: {{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Chart.Name }} + aadpodidbinding: osdu-identity + spec: + volumes: + - name: azure-keyvault + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: azure-keyvault + - name: shared-data + emptyDir: {} + imagePullSecrets: + - name: {{ .Values.image.imagePullSecrets }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.app.repository }}:{{ .Values.app.tag }}" + imagePullPolicy: {{ .Values.app.pullPolicy }} + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /api/crs/converter/_ah/readiness_check + port: 8080 + volumeMounts: + - name: azure-keyvault + mountPath: "/mnt/azure-keyvault" + readOnly: true + env: + - name: spring_application_name + value: crs-conversion-service + - name: server.servlet.contextPath + value: /api/crs/converter/ + - name: server_port + value: "8080" + - name: ACCEPT_HTTP # TEMPORARY UNTIL HTTPS + value: "true" + - name: KEYVAULT_URI + valueFrom: + configMapKeyRef: + name: osdu-svc-properties + key: ENV_KEYVAULT + - name: AZURE_TENANT_ID + valueFrom: + configMapKeyRef: + name: osdu-svc-properties + key: ENV_TENANT_ID + - name: client-id + valueFrom: + secretKeyRef: + name: clientid + key: clientid + - name: AZURE_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: clientpassword + key: clientpassword + - name: aad_client_id + valueFrom: + secretKeyRef: + name: appid + key: appid + - name: appinsights_key + valueFrom: + secretKeyRef: + name: appinsights + key: appinsights + - name: ENTITLEMENT_URL + value: http://entitlements-azure/entitlements/v1 + - name: azure_istioauth_enabled + value: "true" + - name: trajectory + image: "{{ .Values.trajectory.repository }}:{{ .Values.trajectory.tag }}" + imagePullPolicy: {{ .Values.trajectory.pullPolicy }} + ports: + - name: http + containerPort: 8081 diff --git a/devops/azure/chart/templates/service.yaml b/devops/azure/chart/templates/service.yaml new file mode 100644 index 00000000..a0134bfb --- /dev/null +++ b/devops/azure/chart/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }} + namespace: osdu +spec: + type: ClusterIP + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + selector: + app: {{ .Chart.Name }} diff --git a/devops/azure/chart/values.yaml b/devops/azure/chart/values.yaml new file mode 100644 index 00000000..9afe99f7 --- /dev/null +++ b/devops/azure/chart/values.yaml @@ -0,0 +1,17 @@ +global: + replicaCount: 1 + +image: + imagePullSecrets: acr + +app: + repository: delfi.azurecr.io/crs-conversion-app + tag: latest + pullPolicy: Always + +trajectory: + repository: delfi.azurecr.io/trajectory + tag: v2 + pullPolicy: IfNotPresent + + diff --git a/pom.xml b/pom.xml index 5b6b734a..7912fbf6 100644 --- a/pom.xml +++ b/pom.xml @@ -8,18 +8,20 @@ <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.9.RELEASE</version> </parent> - + <properties> <java.version>1.8</java.version> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation> + <spring-boot-version>2.2.9.RELEASE</spring-boot-version> <springfox-version>2.9.2</springfox-version> <powermock.version>2.0.6</powermock.version> <slf4j.version>1.7.25</slf4j.version> <docker.image.prefix>org.opengroup.osdu</docker.image.prefix> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <os-core-common.version>0.3.3</os-core-common.version> + <os-core-common.version>0.3.8</os-core-common.version> + <snakeyaml.version>1.26</snakeyaml.version> </properties> <licenses> @@ -54,29 +56,38 @@ <distributionManagement> <repository> <id>${gitlab-server}</id> - <url>https://community.opengroup.org/api/v4/projects/22/packages/maven</url> + <url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url> </repository> <snapshotRepository> <id>${gitlab-server}</id> - <url>https://community.opengroup.org/api/v4/projects/22/packages/maven</url> + <url>https://community.opengroup.org/api/v4/projects/74/packages/maven</url> </snapshotRepository> </distributionManagement> <dependencyManagement> <dependencies> <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + <version>${snakeyaml.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-security</artifactId> + <artifactId>spring-boot-starter-web</artifactId> + <version>${spring-boot-version}</version> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-security</artifactId> + <version>${spring-boot-version}</version> + </dependency> + <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> + <version>${spring-boot-version}</version> <scope>test</scope> </dependency> diff --git a/provider/crs-converter-azure/crs-converter-aks/Dockerfile b/provider/crs-converter-azure/crs-converter-aks/Dockerfile deleted file mode 100644 index 2fe53f37..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM openjdk:8-jdk-alpine - -# Path to the jar file. E.g. provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-*.jar -ARG CRS_CONVERTER_JAR_PATH - -ARG ENTITLEMENT_URL - -ENV ENTITLEMENT_URL=$ENTITLEMENT_URL - -EXPOSE 8080 - -COPY $CRS_CONVERTER_JAR_PATH ./crs-converter/crs-converter.jar - -WORKDIR ./crs-converter - -ENTRYPOINT ["java", "-jar", "crs-converter.jar"] diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/.helmignore b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/.helmignore deleted file mode 100644 index 05d5aabd..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/.helmignore +++ /dev/null @@ -1,22 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/Chart.yaml b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/Chart.yaml deleted file mode 100644 index 7f8a4e54..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Kubernetes Helm chart for crs converter -name: crs-converter-aks -version: v2 diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/NOTES.txt b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/NOTES.txt deleted file mode 100644 index de7c5c35..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/NOTES.txt +++ /dev/null @@ -1,21 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range $.Values.ingress.paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "crs-converter-aks.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ include "crs-converter-aks.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "crs-converter-aks.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "crs-converter-aks.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/_helpers.tpl b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/_helpers.tpl deleted file mode 100644 index 4bc4a1c3..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "crs-converter-aks.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "crs-converter-aks.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "crs-converter-aks.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/deployment.yaml b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/deployment.yaml deleted file mode 100644 index 21a0ae18..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/deployment.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: crs-converter-aks - namespace: {{ .Values.namespace }} - labels: - app: crs-converter-aks - version: v2 -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: crs-converter-aks - version: v2 - template: - metadata: - labels: - app: crs-converter-aks - version: v2 - spec: - containers: - - name: crs-converter - image: "{{ .Values.image.converter.repository }}:{{ .Values.image.converter.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: {{ .Values.service.http.targetPort }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - env: - - name: ENTITLEMENT_URL - value: "{{.Values.service.entitlement.url}}" - - name: client-id - value: "{{.Values.service.client.url}}" - imagePullSecrets: - - name: {{ .Values.image.imagePullSecrets }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/ingress.yaml b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/ingress.yaml deleted file mode 100644 index ba534606..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/ingress.yaml +++ /dev/null @@ -1,40 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "crs-converter-aks.fullname" . -}} -{{- $ingressPaths := .Values.ingress.paths -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - app.kubernetes.io/name: {{ include "crs-converter-aks.name" . }} - crs-converter-aks.sh/chart: {{ include "crs-converter-aks.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . | quote }} - http: - paths: - {{- range $ingressPaths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} - {{- end }} -{{- end }} diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/service.yaml b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/service.yaml deleted file mode 100644 index 31ecc060..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/templates/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: crs-converter-aks - labels: - app: crs-converter-aks -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.http.port }} - targetPort: {{ .Values.service.http.targetPort }} - name: http - selector: - app: crs-converter-aks diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml deleted file mode 100644 index f5bfb4d8..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Default values for helm. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -namespace: osdu-core -replicaCount: 1 - -image: - repository: hubpoc.azurecr.io/crs-converter-aks - tag: v2 - pullPolicy: Always - imagePullSecrets: acr - -nameOverride: "" -fullnameOverride: "" - -service: - type: NodePort - http: - port: 80 - targetPort: 8080 - https: - port: 443 - targetPort: 8443 - entitlements: - host: entitlements-dot-opendes.appspot.com - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - paths: [] - hosts: - - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml.tmpl b/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml.tmpl deleted file mode 100644 index 22420ed0..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/crs-converter-aks/values.yaml.tmpl +++ /dev/null @@ -1,56 +0,0 @@ -# Default values for helm. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - converter: - repository: delfi.azurecr.io/crs-converter-aks - tag: v2 - pullPolicy: Always - imagePullSecrets: acr - -nameOverride: "" -fullnameOverride: "" - -service: - type: NodePort - http: - port: 80 - targetPort: 8080 - entitlement: - url: ENTITLEMENT_URL - client: - url: client-id - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - paths: [] - hosts: - - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/provider/crs-converter-azure/crs-converter-aks/devops/azure-pipelines.yml b/provider/crs-converter-azure/crs-converter-aks/devops/azure-pipelines.yml deleted file mode 100644 index e4834862..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/devops/azure-pipelines.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Maven package Java project Web App to Linux on Azure -# Build your Java project and deploy it to Azure as a Linux web app -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/java - -# Required Group Variables - `Service Pipeline Variables` - # VM_IMAGE_NAME -- Agent VM image name - # AZURE_SUBSCRIPTION - ${{env_name}} -- Azure Resource Manager service connection created during pipeline creation - -# Required Group Variables - `Service Pipeline Variables - {env_name}` - # AZURE_AD_APP_RESOURCE_ID - # AZURE_AD_OTHER_APP_RESOURCE_ID - # AZURE_AD_TENANT_ID -- Azure Subscription Id - # DOMAIN - # ENTITLEMENT_APP_KEY -- Check the terraform.tfstateenv to find out the value of "entitlement-key" - # ENTITLEMENT_URL -- end with '/' - # ENVIRONMENT_NAME - # EXPIRED_TOKEN - # INTEGRATION_TESTER - # MY_TENANT - # ENTITLEMENTS_WEBAPPNAME - -trigger: - branches: - include: - - master - paths: - exclude: - - README.md - - OpenDES_Azure_Security.md - - .gitignore - - images/* - -variables: - - group: 'AZURE_REGISTRY_DELFI' - - group: 'Azure Common Secrets' - - group: 'Azure - Common' - - group: 'PACT_TEST' - - group: 'Azure Service Release - crs-converter' - - name: imageName - value: 'crs-converter-aks' - - name: crsConverterJarPath - value: 'provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-*.jar' - -stages: - - template: stages.yml - parameters: - environments: - - name: 'devint' - kubeconfig: 'devint-aks-kubeconfig' - - ${{ if eq(variables['Build.SourceBranchName'], 'master') }}: - - name: 'qa' - kubeconfig: 'qa-aks-kubeconfig' - - name: 'prod' - kubeconfig: 'prod-aks-kubeconfig' diff --git a/provider/crs-converter-azure/crs-converter-aks/devops/stages.yml b/provider/crs-converter-azure/crs-converter-aks/devops/stages.yml deleted file mode 100644 index 768a337f..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/devops/stages.yml +++ /dev/null @@ -1,170 +0,0 @@ -parameters: - environments: [] - -stages: - - ${{ each environment in parameters.environments }}: - - stage: 'Build_${{ environment.name }}' - - variables: - - group: 'Azure Target Env - ${{environment.name}}' - - group: 'Azure Target Env Secrets - ${{environment.name}}' - - name: tag - value: 'v2' - - jobs: - - job: MavenPackageAndPublishArtifacts - displayName: Maven Package and Publish Artifacts - pool: $(AGENT_POOL) - - steps: - - ${{ if eq(environment.name, 'devint') }}: - - task: Maven@3 - displayName: 'Maven: build, and test all modules' - inputs: - mavenPomFile: 'pom.xml' - goals: 'install' - options: '--settings ./maven/settings.xml -DVSTS_FEED_TOKEN=$(VSTS_FEED_TOKEN) -Dclient-id=$(aad_client_id) ' - testResultsFiles: '**/*/TEST-*.xml' - codeCoverageToolOption: JaCoCo - - task: Maven@3 - displayName: 'Maven, crs-converter-aks: test, code coverage' - inputs: - mavenPomFile: 'pom.xml' - goals: 'test' - options: '--settings ./maven/settings.xml -DVSTS_FEED_TOKEN=$(VSTS_FEED_TOKEN) -Dclient-id=$(aad_client_id)' - testResultsFiles: '**/*/TEST-*.xml' - codeCoverageToolOption: JaCoCo - - - bash: | - #!/bin/bash - set -e - docker login -u $(dockerId) -p $(dockerPassword) $(dockerId).azurecr.io - docker build -t $(dockerId).azurecr.io/$(imageName):$(tag) --build-arg CRS_CONVERTER_JAR_PATH=$(crsConverterJarPath) . - echo 'Image done.' - - docker push $(dockerId).azurecr.io/$(imageName) - docker tag $(dockerId).azurecr.io/$(imageName):$(tag) $(dockerId).azurecr.io/$(imageName):latest - - echo 'Added $(dockerId).azurecr.io/$(imageName):latest tag to $(dockerId).azurecr.io/$(imageName):$(tag)' - docker push $(dockerId).azurecr.io/$(imageName):$(tag) - - echo 'Pushed $(dockerId).azurecr.io/$(imageName):$(tag)' - docker push $(dockerId).azurecr.io/$(imageName):latest - echo 'Pushed $(dockerId).azurecr.io/$(imageName):latest' - displayName: 'build and upload docker image $(dockerId).azurecr.io/$(imageName)' - - bash: | - #!/bin/bash - set -e - pushd provider/crs-converter-azure/crs-converter-aks/crs-converter-aks - sed "s|ENTITLEMENT_URL|$(ENTITLEMENT_URL)|g" values.yaml.tmpl > values.yaml - sed -i "s|client-id|$(AZURE_AD_APP_RESOURCE_ID)|g" values.yaml - echo "Content:" - cat values.yaml - echo "" - popd - displayName: 'generate values.yaml with actual variables: $(ENTITLEMENT_URL) ${client-id}' - - bash: | - #!/bin/bash - set -e - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 - chmod 700 get_helm.sh - ./get_helm.sh - # package helm chart - helm package provider/crs-converter-azure/crs-converter-aks/crs-converter-aks --version 0.0.1 --destination '$(build.artifactstagingdirectory)' - displayName: 'install helm 3 and package helm chart' - - bash: | - #!/bin/bash - set -e - # Zip integration tests and upload it as artifact - zip -r testing.zip testing - cp testing.zip $(build.artifactstagingdirectory) - displayName: 'Zip integration tests and upload it as artifact' - - upload: $(Build.ArtifactStagingDirectory) - artifact: drop_${{environment.name}} - - - stage: Deploy_${{environment.name}} - dependsOn: 'Build_${{ environment.name }}' - condition: succeeded() - - variables: - - group: 'Azure Target Env - ${{environment.name}}' - - group: 'Azure Target Env Secrets - ${{environment.name}}' - - group: 'AKS Target Env - ${{ environment.name }}' - - name: tag - value: 'v2' - - jobs: - - deployment: DeployLinuxWebApp - displayName: Deploy Linux Web App - environment: ${{ environment.name }} - pool: $(AGENT_POOL) - - strategy: - runOnce: - deploy: - steps: - - task: DownloadSecureFile@1 - name: kubeConfig - inputs: - secureFile: 'kubeconfig-${{environment.name}}' - - task: KubectlInstaller@0 - displayName: 'Install Kubectl latest' - - bash: | - #!/bin/bash - set -e - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 - chmod 700 get_helm.sh - ./get_helm.sh - displayName: 'Install helm 3' - - task: HelmDeploy@0 - displayName: 'helm upgrade' - inputs: - connectionType: Kubernetes Service Connection - kubernetesServiceEndpoint: ${{ environment.kubeconfig }} - command: upgrade - arguments: '--wait' - chartType: FilePath - chartPath: '$(Pipeline.Workspace)/drop_${{environment.name}}/crs-converter-aks-0.0.1.tgz' - releaseName: 'crs-converter-aks' - - - bash: | - #!/bin/bash - set -e - kubectl --kubeconfig $(kubeConfig.secureFilePath) rollout restart deployment/crs-converter-aks - displayName: 'kubectl rollout restart deployment/crs-converter-aks' - - - ${{ if or(eq(environment.name, 'devint'), eq(environment.name, 'qa')) }}: - - bash: | - #!/bin/bash - set -e - - echo "Current working directory: " - pwd - echo "Contents of $(Pipeline.Workspace)/drop_${{environment.name}}: " - ls -al $(Pipeline.Workspace)/drop_${{environment.name}} - # Unzip integration tests - unzip $(Pipeline.Workspace)/drop_${{environment.name}}/testing.zip -d $(Pipeline.Workspace)/drop_${{environment.name}}/ - chmod +x $(Pipeline.Workspace)/drop_${{environment.name}}/testing/crs_converter_test_sauth/run-integration-tests.sh - - printf 'waiting for service to be ready:' - sleep 10 - attempt_counter=0 - max_attempts=60 - until [ $(curl -s -o /dev/null -w "%{http_code}" https://$(VIRTUAL_SERVICE_HOST_NAME)/api/crs/converter/_ah/liveness_check) -eq 200 ]; do - if [ ${attempt_counter} -ge ${max_attempts} ]; then - echo "Service is not available, please check the deployment" - exit 1 - fi - printf '.' - attempt_counter=$(($attempt_counter+1)) - sleep 2 - done - - displayName: 'Unzip integration tests and Wait for service to be ready' - - task: Bash@3 - displayName: 'Run integration tests' - inputs: - targetType: filePath - filePath: '$(Pipeline.Workspace)/drop_${{environment.name}}/testing/crs_converter_test_sauth/run-integration-tests.sh' - arguments: '$(AUTH_SECRET) $(AUTH_SERVICE_TOKEN_X_API_KEY)' - workingDirectory: '$(Pipeline.Workspace)/drop_${{environment.name}}/testing/crs_converter_test_sauth' diff --git a/provider/crs-converter-azure/crs-converter-aks/external/entitlement-service.yaml b/provider/crs-converter-azure/crs-converter-aks/external/entitlement-service.yaml deleted file mode 100644 index 38568e7e..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/external/entitlement-service.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: entitlements -spec: - type: ExternalName - externalName: entitlements-dot-opendes.appspot.com \ No newline at end of file diff --git a/provider/crs-converter-azure/crs-converter-aks/istio/destination-rule.yaml b/provider/crs-converter-azure/crs-converter-aks/istio/destination-rule.yaml deleted file mode 100644 index 8b3899b4..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/istio/destination-rule.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2017-2019, Schlumberger -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: networking.istio.io/v1alpha3 -kind: DestinationRule -metadata: - name: crs-converter-aks -spec: - host: crs-converter-aks - subsets: - - name: v2 - labels: - version: v2 \ No newline at end of file diff --git a/provider/crs-converter-azure/crs-converter-aks/istio/gateway.yaml b/provider/crs-converter-azure/crs-converter-aks/istio/gateway.yaml deleted file mode 100644 index 187f43c7..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/istio/gateway.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2017-2019, Schlumberger -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: networking.istio.io/v1alpha3 -kind: Gateway -metadata: - name: crs-converter-aks-gateway -spec: - selector: - istio: ingressgateway # use istio default controller - servers: - - port: - number: 80 - name: http - protocol: HTTP - hosts: - - "*" \ No newline at end of file diff --git a/provider/crs-converter-azure/crs-converter-aks/istio/virtualservice-v2.yaml b/provider/crs-converter-azure/crs-converter-aks/istio/virtualservice-v2.yaml deleted file mode 100644 index 68e4fafb..00000000 --- a/provider/crs-converter-azure/crs-converter-aks/istio/virtualservice-v2.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2017-2019, Schlumberger -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: crs-converter-aks -spec: - hosts: - - "*" - gateways: - - crs-converter-aks-gateway - http: - - match: - - uri: - prefix: /api/crs/converter - route: - - destination: - host: crs-converter-aks - port: - number: 80 - subset: v2 \ No newline at end of file diff --git a/provider/crs-converter-azure/crs-converter-aks/pom.xml b/provider/crs-converter-azure/crs-converter-aks/pom.xml index 197a2b2c..4ddc545b 100644 --- a/provider/crs-converter-azure/crs-converter-aks/pom.xml +++ b/provider/crs-converter-azure/crs-converter-aks/pom.xml @@ -38,7 +38,12 @@ <artifactId>azure-active-directory-spring-boot-starter</artifactId> <version>${azure.version}</version> </dependency> - + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> </dependencies> <build> diff --git a/provider/crs-converter-azure/crs-converter-aks/src/main/java/org/opengroup/osdu/crs/CRSApplication.java b/provider/crs-converter-azure/crs-converter-aks/src/main/java/org/opengroup/osdu/crs/CRSApplication.java index 8704b92b..f2d0bca0 100644 --- a/provider/crs-converter-azure/crs-converter-aks/src/main/java/org/opengroup/osdu/crs/CRSApplication.java +++ b/provider/crs-converter-azure/crs-converter-aks/src/main/java/org/opengroup/osdu/crs/CRSApplication.java @@ -2,9 +2,7 @@ package org.opengroup.osdu.crs; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -@ComponentScan({"org.opengroup.osdu"}) @SpringBootApplication public class CRSApplication extends CRSApplicationBase { diff --git a/provider/crs-converter-azure/crs-converter-aks/src/main/resources/application.yaml b/provider/crs-converter-azure/crs-converter-aks/src/main/resources/application.yaml index 457b92a0..c58ab64b 100644 --- a/provider/crs-converter-azure/crs-converter-aks/src/main/resources/application.yaml +++ b/provider/crs-converter-azure/crs-converter-aks/src/main/resources/application.yaml @@ -15,7 +15,4 @@ logging: springframework: web: INFO LOG_PREFIX: converter -azure: - activedirectory: - client-id: ${client-id} - session-stateless: true + diff --git a/testing/crs_converter_test_core/test_crs_converter.py b/testing/crs_converter_test_core/test_crs_converter.py index 26b14c54..aeea2c77 100644 --- a/testing/crs_converter_test_core/test_crs_converter.py +++ b/testing/crs_converter_test_core/test_crs_converter.py @@ -517,9 +517,8 @@ class TestUnAuthorizedCrsConverterIntegration(unittest.TestCase): api_response=self.api_instance.convert_point(body=request, data_partition_id=data_partition_header, _request_timeout=180) self.fail(api_response) except ApiException as e: - reason = json.loads(e.body)['error'] self.assertTrue(403==e.status or 401==e.status) - self.assertTrue("Forbidden"==reason or "Unauthorized"==reason) + self.assertTrue("Forbidden"==e.reason or "Unauthorized"==e.reason) if __name__ == '__main__': -- GitLab