Skip to content

Commit

Permalink
Set up bastion tunnel for scicat services
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic authored Jan 4, 2024
1 parent a36bf77 commit 437dba6
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 55 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/materialised-view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Open ssh tunnel
uses: paulscherrerinstitute/scicat-ci/.github/actions/open-ssh-tunnel@main
with:
bastion_user: '${{ secrets.BASTION_USER }}'
bastion_ssh_key: '${{ secrets.BASTION_SSH_KEY }}'

- name: deploy
uses: paulscherrerinstitute/scicat-ci/.github/actions/deploy-helm@main
with:
Expand All @@ -46,3 +52,5 @@ jobs:
RELEASE_NAME: materialised-view
ENVIRONMENT: '${{ needs.set_env.outputs.environment }}'
NAMESPACE_PREFIX: scicat-
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/proposals-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ jobs:
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
JSON_SECRETS: ${{ toJSON(secrets) }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
12 changes: 12 additions & 0 deletions .github/workflows/reusable.build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ on:
SSH_PRIVATE_KEY:
description: ssh key to private submodule
required: false
BASTION_USER:
description: ssh bastion user@server
required: true
BASTION_SSH_KEY:
description: bastion ssh key
required: true

jobs:

Expand Down Expand Up @@ -131,6 +137,12 @@ jobs:
with:
ref: ${{ inputs.commit }}

- name: Open ssh tunnel
uses: paulscherrerinstitute/scicat-ci/.github/actions/open-ssh-tunnel@main
with:
bastion_user: '${{ secrets.BASTION_USER }}'
bastion_ssh_key: '${{ secrets.BASTION_SSH_KEY }}'

- name: Deploy to k8s using helm
id: helm-deploy
uses: paulscherrerinstitute/scicat-ci/.github/actions/deploy-helm@main
Expand Down
106 changes: 54 additions & 52 deletions .github/workflows/scicat-be-next.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
name: scicat-be-next
# name: scicat-be-next

on:
workflow_dispatch:
inputs:
submodule_commit:
description: 'Commit of the submodule to deploy'
required: false
commit:
description: 'Commit of the CI repo to deploy'
required: false
pull_request:
branches: [ main ]
push:
branches: [ main ]
release:
types: [ published ]
# on:
# workflow_dispatch:
# inputs:
# submodule_commit:
# description: 'Commit of the submodule to deploy'
# required: false
# commit:
# description: 'Commit of the CI repo to deploy'
# required: false
# pull_request:
# branches: [ main ]
# push:
# branches: [ main ]
# release:
# types: [ published ]

jobs:
# jobs:

set_env:
uses: ./.github/workflows/reusable.environment.yml
with:
commit: ${{ github.event.inputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
# set_env:
# uses: ./.github/workflows/reusable.environment.yml
# with:
# commit: ${{ github.event.inputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}

check_changed:
needs: set_env
uses: ./.github/workflows/reusable.changes.yml
with:
files: |
.github/workflows/scicat-be-next.yml
helm/configs/backend-next/${{ needs.set_env.outputs.environment }}/**
helm/configs/backend-next/values.yaml
scicat-backend-next/**
commit: ${{ needs.set_env.outputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
submodule: scicat-backend-next
# check_changed:
# needs: set_env
# uses: ./.github/workflows/reusable.changes.yml
# with:
# files: |
# .github/workflows/scicat-be-next.yml
# helm/configs/backend-next/${{ needs.set_env.outputs.environment }}/**
# helm/configs/backend-next/values.yaml
# scicat-backend-next/**
# commit: ${{ needs.set_env.outputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
# submodule: scicat-backend-next

build_deploy_scicat_backend_next:
if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component) || needs.set_env.outputs.component == 'bn'
needs:
- check_changed
- set_env
uses: ./.github/workflows/reusable.build-deploy.yml
with:
context: scicat-backend-next/.
image_name: ${{ github.repository }}/backend-next
release_name: backend-next
tag: ${{ needs.set_env.outputs.tag }}
environment: ${{ needs.set_env.outputs.environment }}
commit: ${{ needs.set_env.outputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
submodule: scicat-backend-next
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
JSON_SECRETS: ${{ toJSON(secrets) }}
# build_deploy_scicat_backend_next:
# if: (needs.check_changed.outputs.changed == 'true' && !needs.set_env.outputs.component) || needs.set_env.outputs.component == 'bn'
# needs:
# - check_changed
# - set_env
# uses: ./.github/workflows/reusable.build-deploy.yml
# with:
# context: scicat-backend-next/.
# image_name: ${{ github.repository }}/backend-next
# release_name: backend-next
# tag: ${{ needs.set_env.outputs.tag }}
# environment: ${{ needs.set_env.outputs.environment }}
# commit: ${{ needs.set_env.outputs.commit }}
# submodule_commit: ${{ github.event.inputs.submodule_commit }}
# submodule: scicat-backend-next
# secrets:
# KUBECONFIG: ${{ secrets.KUBECONFIG }}
# JSON_SECRETS: ${{ toJSON(secrets) }}
# BASTION_USER: ${{ secrets.BASTION_USER }}
# BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/scicat-be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ jobs:
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
JSON_SECRETS: ${{ toJSON(secrets) }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/scicat-fe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
ENVIRONMENT=helm/configs/frontend/${{ needs.set_env.outputs.environment }}/config.json
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/scicat-landing-page-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
JSON_SECRETS: ${{ toJSON(secrets) }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/scicat-oaipmh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ jobs:
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
JSON_SECRETS: ${{ toJSON(secrets) }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
3 changes: 2 additions & 1 deletion .github/workflows/scicat-pan-ontologies-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ jobs:
submodule: pan-ontologies-api
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}

BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
8 changes: 7 additions & 1 deletion .github/workflows/scicat-pss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Open ssh tunnel
uses: paulscherrerinstitute/scicat-ci/.github/actions/open-ssh-tunnel@main
with:
bastion_user: '${{ secrets.BASTION_USER }}'
bastion_ssh_key: '${{ secrets.BASTION_SSH_KEY }}'

- name: deploy
uses: paulscherrerinstitute/scicat-ci/.github/actions/deploy-helm@main
with:
release: '${{ env.RELEASE_NAME }}'
namespace: '${{ env.NAMESPACE_PREFIX }}${{ env.ENVIRONMENT }}'
chart: '${{ env.RELEASE_NAME }}'
chart: helm/charts/generic_service
values: "db=${{ env.RELEASE_NAME }}-${{ env.ENVIRONMENT }}"
value-files: helm/configs/${{ env.RELEASE_NAME }}/values.yaml
secrets: ${{ toJSON(secrets) }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scicat-search-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ jobs:
COMPONENT_CONFIG=helm/configs/search-api/component-config.json
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/scicat-to-pss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ jobs:
commit: ${{ needs.set_env.outputs.commit }}
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
BASTION_USER: ${{ secrets.BASTION_USER }}
BASTION_SSH_KEY: ${{ secrets.BASTION_SSH_KEY }}
2 changes: 1 addition & 1 deletion proposals/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "proposals"
version = "0.1.0"
description = "A microservice for syncing proposals from duo to scicat"
authors = ["[email protected]", "carlo.minotti@psi.ch", "[email protected]"]
authors = ["AWI-7903 <awi-7903@psi.ch>"]

[tool.poetry.dependencies]
python = "^3.8"
Expand Down

0 comments on commit 437dba6

Please sign in to comment.