Skip to content
Snippets Groups Projects
Commit df65245b authored by Sumra Zafar's avatar Sumra Zafar
Browse files

Revert "Reversion"

This reverts commit bb1a91ee.
parent ad522bfd
No related branches found
No related tags found
No related merge requests found
Showing
with 512 additions and 92 deletions
variables:
SIS_DATA: $CI_PROJECT_DIR/apachesis_setup/SIS_DATA
AZURE_SERVICE: crs_converter
AZURE_BUILD_SUBDIR: provider/crs-converter-azure/crs-converter-aks
AZURE_TEST_SUBDIR: testing/crs_converter_test_azure
AWS_BUILD_SUBDIR: provider/crs-converter-aws/build-aws
AWS_TEST_SUBDIR: testing/crs_converter_test_aws
AWS_SERVICE: crs-conversion
......@@ -24,6 +29,9 @@ include:
- project: "osdu/platform/ci-cd-pipelines"
file: "scanners/gitlab-ultimate.yml"
- project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/azure.yml"
- project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/aws.yml"
......
FROM openjdk:8-jdk-alpine
COPY provider/crs-converter-azure/crs-converter-aks/target/crs-converter-aks-1.0.0.jar /app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# Copyright Microsoft Corporation
#
# 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: v2
name: crs-conversion-service
appVersion: "latest"
description: Helm Chart for installing crs-conversion-service service.
version: 0.1.0
name: crs-converter
description: A Helm chart for installing crs-conversion-service on Azure
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "latest"
\ No newline at end of file
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "azure-crs-converter.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 --namespace {{ .Release.Namespace }} svc -w {{ include "azure-crs-converter.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "azure-crs-converter.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
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 "azure-crs-converter.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 --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}
{{/*
Expand the name of the chart.
*/}}
{{- define "azure-crs-converter.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 "azure-crs-converter.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 "azure-crs-converter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "azure-crs-converter.labels" -}}
helm.sh/chart: {{ include "azure-crs-converter.chart" . }}
{{ include "azure-crs-converter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "azure-crs-converter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "azure-crs-converter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "azure-crs-converter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "azure-crs-converter.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
# Copyright © Microsoft Corporation
#
# 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: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
namespace: osdu
name: {{ include "azure-crs-converter.fullname" . }}
labels:
app: {{ .Chart.Name }}
appversion: {{ .Chart.Version }}
aadpodidbinding: osdu-identity
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.global.replicaCount }}
{{- end }}
selector:
matchLabels:
aadpodidbinding: osdu-identity
app: {{ .Chart.Name }}
appversion: {{ .Chart.Version }}
template:
metadata:
labels:
app: {{ .Chart.Name }}
aadpodidbinding: osdu-identity
app: {{ .Chart.Name }}
appversion: {{ .Chart.Version }}
spec:
volumes:
- name: azure-keyvault
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: azure-keyvault
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.image.repository }}/{{ .Chart.Name }}-{{ .Values.image.branch }}:{{ .Values.image.tag | default .Chart.AppVersion }}
imagePullPolicy: Always
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /api/crs/converter/swagger-ui.html
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:
secretKeyRef:
name: active-directory
key: tenantid
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: principal-clientid
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: active-directory
key: principal-clientpassword
- name: appinsights_key
valueFrom:
secretKeyRef:
name: central-logging
key: appinsights
- name: aad_client_id
valueFrom:
secretKeyRef:
name: active-directory
key: application-appid
- name: ENTITLEMENT_URL
value: http://entitlements-azure/entitlements/v1
- name: azure_istioauth_enabled
value: "true"
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: azure-keyvault
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}/{{ .Chart.Name }}-{{ .Values.image.branch }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.application.port }}
protocol: TCP
readinessProbe:
httpGet:
path: /api/crs/converter/swagger-ui.html
port: {{ .Values.application.port }}
initialDelaySeconds: 45
timeoutSeconds: 15
periodSeconds: 2
successThreshold: 1
failureThreshold: 5
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:
secretKeyRef:
name: active-directory
key: tenantid
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: principal-clientid
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: active-directory
key: principal-clientpassword
- name: appinsights_key
valueFrom:
secretKeyRef:
name: central-logging
key: appinsights
- name: aad_client_id
valueFrom:
secretKeyRef:
name: active-directory
key: application-appid
- name: ENTITLEMENT_URL
value: http://entitlements-azure/entitlements/v1
- name: azure_istioauth_enabled
value: "true"
- name: ESRI_DATA_PATH
value: \crs-conversion-service
- name: cosmosdb_database
value: osdu-db
- name: service_domain_name
value: contoso.com
# Copyright © Microsoft Corporation
#
# 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: v1
kind: Service
metadata:
name: {{ .Chart.Name }}
name: crs-conversion-service
namespace: osdu
labels:
resource: "crsService"
app: {{ .Chart.Name }}
appversion: {{ .Chart.Version }}
aadpodidbinding: osdu-identity
spec:
type: ClusterIP
type: {{ .Values.service.type }}
ports:
- protocol: TCP
port: 80
targetPort: 8080
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetport }}
protocol: TCP
name: http
selector:
app: {{ .Chart.Name }}
appversion: {{ .Chart.Version }}
aadpodidbinding: osdu-identity
# Copyright © Microsoft Corporation
#
# 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.
global:
replicaCount: 1
image:
repository: ${CONTAINER_REGISTRY_NAME}.azurecr.io/crs-conversion-app
tag: latest
repository: community.opengroup.org:5555/osdu/platform/system/reference/crs-conversion-service
pullPolicy: Always
branch: master
tag: latest
service:
type: ClusterIP
port: 80
targetport: 8080
application:
port: 8080
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
trigger:
batch: true
branches:
......@@ -31,9 +30,6 @@ variables:
value: "devops/azure/chart/helm-config.yaml"
- name: 'MANIFEST_REPO'
value: $[ resources.repositories['FluxRepo'].name ]
- name: dockerFile
value: "devops/azure/Dockerfile"
stages:
- template: /devops/build-stage.yml@TemplateRepo
parameters:
......@@ -45,7 +41,6 @@ stages:
pom.xml
provider/crs-converter-azure/crs-converter-aks/pom.xml
provider/crs-converter-azure/crs-converter-aks/target/*.jar
devops/azure/Dockerfile
copyFileContentsToFlatten: ''
mavenSettingsFile: './maven/settings.xml'
serviceBase: ${{ variables.serviceName }}
......@@ -57,7 +52,6 @@ stages:
serviceName: ${{ variables.serviceName }}
chartPath: ${{ variables.chartPath }}
valuesFile: ${{ variables.valuesFile }}
dockerFile: ${{ variables.dockerFile }}
testCoreMavenPomFile: ''
testCoreMavenOptions: ''
skipDeploy: ${{ variables.SKIP_DEPLOY }}
......
---
# Source: crs-converter/templates/service.yaml
# Copyright © Microsoft Corporation
#
# 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: v1
kind: Service
metadata:
name: crs-conversion-service
namespace: osdu
labels:
resource: "crsService"
app: crs-converter
appversion: 0.1.0
aadpodidbinding: osdu-identity
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
app: crs-converter
appversion: 0.1.0
aadpodidbinding: osdu-identity
---
# Source: crs-converter/templates/deployment.yaml
# Copyright © Microsoft Corporation
#
# 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: apps/v1
kind: Deployment
metadata:
namespace: osdu
name: osdu-gitlab-crs-conversion-service-crs-converter
labels:
app: crs-converter
appversion: 0.1.0
aadpodidbinding: osdu-identity
spec:
replicas: 1
selector:
matchLabels:
aadpodidbinding: osdu-identity
app: crs-converter
appversion: 0.1.0
template:
metadata:
labels:
aadpodidbinding: osdu-identity
app: crs-converter
appversion: 0.1.0
spec:
volumes:
- name: azure-keyvault
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: azure-keyvault
containers:
- name: crs-converter
image: "community.opengroup.org:5555/osdu/platform/system/reference/crs-conversion-service/crs-converter-master:latest"
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
path: /api/crs/converter/swagger-ui.html
port: 8080
initialDelaySeconds: 45
timeoutSeconds: 15
periodSeconds: 2
successThreshold: 1
failureThreshold: 5
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:
secretKeyRef:
name: active-directory
key: tenantid
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: active-directory
key: principal-clientid
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: active-directory
key: principal-clientpassword
- name: appinsights_key
valueFrom:
secretKeyRef:
name: central-logging
key: appinsights
- name: aad_client_id
valueFrom:
secretKeyRef:
name: active-directory
key: application-appid
- name: ENTITLEMENT_URL
value: http://entitlements-azure/entitlements/v1
- name: azure_istioauth_enabled
value: "true"
- name: ESRI_DATA_PATH
value: \crs-conversion-service
- name: cosmosdb_database
value: osdu-db
- name: service_domain_name
value: contoso.com
\ No newline at end of file
......@@ -22,7 +22,7 @@
</prerequisites>
<artifactId>crs-converter-aks</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<name>crs-converter-aks</name>
<description>CRS converter service Azure Kubernetes Deployment</description>
......
adal==1.2.2
boto3==1.14.40
botocore==1.17.54
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
cryptography==2.8
docutils==0.15.2
idna==2.9
jmespath==0.10.0
pycparser==2.20
PyJWT==1.7.1
python-dateutil==2.8.1
requests==2.23.0
s3transfer==0.3.3
six==1.14.0
urllib3==1.25.8
xmlrunner==1.7.7
\ No newline at end of file
#!/usr/bin/bash
# Install venv for python3
which apt-get && sudo apt-get install -y python3 python3-pip python3-venv || echo "Not Ubuntu, skipping"
which yum && sudo yum install -y python3 python3-pip python3-venv || echo "Not RHEL, skipping"
# if [[ "$OSTYPE" =~ ^msys ]]; then #windows
# if ! [ -x "$(command -v virtualenv)" ]; then
# python -m pip install virtualenv
# fi
# python -m venv env
# source env/Scripts/activate
# python -m pip install --upgrade pip
# python -m pip install -r requirements.txt
# else
python3 -m venv env
#sed -i 's/$1/${1:-}/' env/bin/activate # Fix deactivation bug '$1 unbound variable'
source env/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
# Run tests
echo ***RUNNING CRS Converter API TESTS***
python3 run_test_api.py
TEST_STATUS=$?
echo ***FINISHED CRS Converter API V2 TESTS***
# python3 -m pip freeze > requirements.txt
python3 -m pip uninstall -r requirements.txt -y
deactivate
rm -rf env/
if [ $TEST_STATUS -ne 0 ]
then
exit 1
fi
import sys
sys.path.append("..")
from crs_converter_test_core.test_crs_converter import *
if __name__ == '__main__':
import xmlrunner
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports/v2', outsuffix='azure'))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment