diff --git a/.github/workflows/uninstall_install_sandbox.yaml b/.github/workflows/uninstall_install_sandbox.yaml new file mode 100644 index 00000000..559f21c0 --- /dev/null +++ b/.github/workflows/uninstall_install_sandbox.yaml @@ -0,0 +1,66 @@ +name: Uninstall and then re-install Traction Sandbox Instance + +on: + schedule: + - cron: '0 9 1,15 * *' + workflow_dispatch: + push: + branches: + - main + +jobs: + uninstall_sandbox: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Run Your Job + run: | + echo "This job runs biweekly on 1st and 15th of every month at 2:00 AM PST" + + - name: Authenticate and set context + uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} + + - name: Uninstall Traction via Helm + continue-on-error: false + run: | + helm uninstall traction-sandbox -n ${{ secrets.OPENSHIFT_NAMESPACE }} --wait --timeout=20m + + - name: Remove Traction Openshift Objects + continue-on-error: false + run: | + oc delete -n ${{ secrets.OPENSHIFT_NAMESPACE }} all,secret,pod,networkpolicy,configmap,pvc --selector "app.kubernetes.io/instance"=traction-sandbox + + install_sandbox: + name: Install Sandbox + needs: uninstall_sandbox + runs-on: ubuntu-20.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Run Your Job + run: | + echo "This job runs biweekly on 1st and 15th of every month at 2:00 AM PST" + + - name: Authenticate and set context + uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} + + - name: Install Traction via Helm + continue-on-error: false + run: | + helm repo add traction https://bcgov.github.io/traction + helm upgrade --install traction-sandbox traction/traction \ + -f ./helm-values/traction/values-sandbox.yaml \ + -n ${{ secrets.OPENSHIFT_NAMESPACE }} --wait --timeout=7m \ No newline at end of file diff --git a/helm-values/tenant-ui/values-sandbox.yaml b/helm-values/tenant-ui/values-sandbox.yaml deleted file mode 100644 index dd9d48f7..00000000 --- a/helm-values/tenant-ui/values-sandbox.yaml +++ /dev/null @@ -1,71 +0,0 @@ -ingressSuffix: .apps.silver.devops.gov.bc.ca -image: - tag: "0.2.14" - pullPolicy: Always -traction: - pluginInnkeeper: - existingSecret: traction-acapy-plugin-innkeeper - generated: true - apiEndpoint: https://traction-sandbox-tenant-proxy.apps.silver.devops.gov.bc.ca - tenantProxyEndpoint: https://traction-sandbox-tenant-proxy.apps.silver.devops.gov.bc.ca - reservation: - expiry_minutes: 2880 - auto_approve: true - auto_issuer: true - resources: - limits: - cpu: 200m - memory: 820Mi - requests: - cpu: 120m - memory: 400Mi - autoscaling: - enabled: true - minReplicas: 1 - maxReplicas: 10 - targetCPUUtilizationPercentage: 80 - targetMemoryUtilizationPercentage: 80 - networkPolicy: - enabled: true - ingress: - enabled: true - namespaceSelector: - network.openshift.io/policy-group: ingress -ui: - image: - pullPolicy: Always -oidc: - active: false - showInnkeeperAdminLogin: true - showWritableComponents: true - authority: "" - jwksUri: "" -ariesDetails: - ledgerDescription: "bcovrin-test" -smtp: - server: apps.smtp.gov.bc.ca - port: 25 - senderAddress: DoNotReplyTractionSandbox@gov.bc.ca - innkeeperInbox: "" -networkPolicy: - enabled: true - ingress: - enabled: true - namespaceSelector: - network.openshift.io/policy-group: ingress -resources: - limits: - cpu: 400m - memory: 1600Mi - requests: - cpu: 200m - memory: 820Mi -ingress: - annotations: - route.openshift.io/termination: edge -networkPolicy: - enabled: true - ingress: - enabled: true - namespaceSelector: - network.openshift.io/policy-group: ingress \ No newline at end of file diff --git a/helm-values/traction/values-sandbox.yaml b/helm-values/traction/values-sandbox.yaml index 061453e5..cc4ae0da 100644 --- a/helm-values/traction/values-sandbox.yaml +++ b/helm-values/traction/values-sandbox.yaml @@ -7,13 +7,20 @@ acapy: generated: true pluginInnkeeper: generated: true + ledgers.yml: + - id: bcovrin-test + is_production: true + is_write: true + genesis_url: 'http://test.bcovrin.vonx.io/genesis' + endorser_did: 'Ket75eV5UQvVkW2XBjgDH7' + endorser_alias: 'bcovrin-test-endorser' plugin-config.yml: traction_innkeeper: innkeeper_wallet: print_key: true print_token: true connect_to_endorser: - - endorser_alias: endorser + - endorser_alias: bcovrin-test-endorser ledger_id: bcovrin-test create_public_did: - bcovrin-test @@ -72,6 +79,12 @@ ui: enabled: true namespaceSelector: network.openshift.io/policy-group: ingress + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 5 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 ingress: annotations: route.openshift.io/termination: edge @@ -82,5 +95,4 @@ postgresql: memory: 1600Mi requests: cpu: 200m - memory: 820Mi - \ No newline at end of file + memory: 820Mi \ No newline at end of file