-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 2.33 KB
/
create_endpoint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Create Hub Ingest Endpoint
on:
workflow_dispatch:
inputs:
username:
description: 'Username for the endpoint'
required: true
type: string
size:
description: 'Storage size (e.g., 50Gi)'
required: true
type: string
env:
BIOC_HUBSINGEST_PATH: "${{ github.workspace }}"
jobs:
create-endpoint:
runs-on: ubuntu-latest
container:
image: amazon/aws-cli:2.22.35
env:
BIOC_HUBSINGEST_PATH: "/hubsingest"
steps:
- name: Install required packages
run: |
yum update -y && yum install -y curl tar gzip openssl
- name: save kubeconfig
shell: bash
run: mkdir -p ~/.kube && echo "${{ secrets.KUBECONFIG }}" > ~/.kube/config
- name: Install Kubectl
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.24.4/bin/linux/amd64/kubectl" && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl && \
kubectl version
- name: Set up environment
run: |
USERNAME_LOWER=$(echo "${{ inputs.username }}" | tr '[:upper:]' '[:lower:]')
USERNAME_UPPER=$(echo "${{ inputs.username }}" | tr '[:lower:]' '[:upper:]')
echo "SECRET_NAME=S3KEY_${USERNAME_UPPER}" >> $GITHUB_ENV
echo "USERNAME=${USERNAME_LOWER}" >> $GITHUB_ENV
- name: Create endpoint then test
run: |
mkdir -p $BIOC_HUBSINGEST_PATH
cd $BIOC_HUBSINGEST_PATH
curl -O https://raw.githubusercontent.com/Bioconductor/hubsingest/devel/install_hubsingest.sh
bash install_hubsingest.sh
export PATH="$PATH:$BIOC_HUBSINGEST_PATH"
hubsingest create_endpoint "${{ env.USERNAME }}" "${{ inputs.size }}" ${{ secrets[env.SECRET_NAME] }}
kubectl wait -n "${{ env.USERNAME }}-ns" --for=condition=ready pod -l app=versitygw --timeout=300s
kubectl wait -n "${{ env.USERNAME }}-ns" --for=condition=ready certificate ${{ env.USERNAME }}-hubsingest-bioconductor-org-key --timeout=600s || bash scripts/reset_endpoint_ssl.sh "${{ env.USERNAME }}" && kubectl wait -n "${{ env.USERNAME }}-ns" --for=condition=ready certificate ${{ env.USERNAME }}-hubsingest-bioconductor-org-key --timeout=600s
sleep 30
hubsingest test_endpoint "${{ env.USERNAME }}"