Launch RStudio Instance #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Launch RStudio Instance | |
on: | |
workflow_dispatch: | |
inputs: | |
username: | |
description: 'Username for the RStudio instance' | |
required: true | |
type: string | |
bioc_version: | |
description: 'Bioconductor version (e.g., 3.18, 3.19, 3.20)' | |
required: false | |
default: '3.20' | |
type: string | |
env: | |
BIOC_HUBSINGEST_PATH: "${{ github.workspace }}" | |
jobs: | |
launch-rstudio: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 && \ | |
sudo mv ./kubectl /usr/local/bin/kubectl && \ | |
kubectl version | |
- name: Set up environment | |
run: | | |
ACTOR_UPPER=$(echo "${{ github.actor }}" | tr '[:lower:]' '[:upper:]') | |
USERNAME_LOWER=$(echo "${{ inputs.username }}" | tr '[:upper:]' '[:lower:]') | |
echo "SECRET_NAME=ADMINPASS_${ACTOR_UPPER}" >> $GITHUB_ENV | |
echo "USERNAME=${USERNAME_LOWER}" >> $GITHUB_ENV | |
- name: Launch RStudio | |
run: | | |
bash install_hubsingest.sh | |
export PATH="$PATH:$BIOC_HUBSINGEST_PATH" | |
hubsingest launch_rstudio "${{ env.USERNAME }}" "${{ secrets[env.SECRET_NAME] }}" "${{ inputs.bioc_version }}" | |
- name: Wait for RStudio and certificate | |
run: | | |
kubectl wait -n "${{ env.USERNAME }}-ns" --for=condition=ready pod -l app=rstudio --timeout=300s | |
kubectl wait -n "${{ env.USERNAME }}-ns" --for=condition=ready certificate ${{ env.USERNAME }}-rstudio-tls --timeout=600s | |
echo "RStudio is available at: https://${{ env.USERNAME }}-rstudio.hubsingest.bioconductor.org" |