-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test workflow for upgrade #2780
Merged
+234
−70
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d67be09
add upgrade workflow
pmeier 4ea15fb
update project and domain
pmeier dad5478
remove unnecessary CI
pmeier 260a364
PR trigger
pmeier 4eba995
use previous defaults
pmeier d1f89fa
progress
pmeier cf9e69c
fix step ids
pmeier 8e8091b
fix outputs
pmeier f6a7d92
use old --show-headers flag
pmeier 0456ecf
add diff and redeploy
pmeier e91a19d
fix URL for playwright tests
pmeier 5058084
add validation
pmeier 3c766fa
add manual upgrade logic
pmeier 2441895
readd other workflows
pmeier 71a0cbb
move DNS check to init-local
pmeier 5b0f821
fix triggers
pmeier 7d2e04f
update concurrency
pmeier f8dde62
Add note regarding the .tfstate workaround
viniciusdc 09e34a5
Merge branch 'main' into upgrade-test-workflow
viniciusdc 94c7527
Merge branch 'main' into upgrade-test-workflow
pmeier b0ae77f
remove temporary TF state handling
pmeier f871c31
Merge branch 'upgrade-test-workflow' of github.com:nebari-dev/nebari …
pmeier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: health-check | ||
description: "Check health of Nebari deployment" | ||
|
||
inputs: | ||
domain: | ||
description: Domain name | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: List kubernetes components | ||
shell: bash | ||
run: kubectl get --all-namespaces all,cm,secret,pv,pvc,ing | ||
|
||
- name: Check if JupyterHub login page is accessible | ||
shell: bash | ||
run: curl --insecure --include 'https://${{ inputs.domain }}/hub/home' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: init-local | ||
description: "Initialize Nebari config for local deployment" | ||
|
||
inputs: | ||
directory: | ||
description: "Path to directory to initialize in" | ||
required: false | ||
default: './local-deployment' | ||
|
||
outputs: | ||
directory: | ||
description: "Path to config directory" | ||
value: ${{ steps.metadata.outputs.directory }} | ||
config: | ||
description: "Path to Nebari config" | ||
value: ${{ steps.metadata.outputs.config }} | ||
project: | ||
description: "Project name" | ||
value: ${{ steps.metadata.outputs.project }} | ||
domain: | ||
description: "Domain name" | ||
value: ${{ steps.metadata.outputs.domain }} | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- shell: bash | ||
id: metadata | ||
run: | | ||
# Setup metadata | ||
DIRECTORY=$(realpath '${{ inputs.directory }}') | ||
mkdir --parents "${DIRECTORY}" | ||
echo "directory=${DIRECTORY}" | tee --append "${GITHUB_OUTPUT}" | ||
|
||
CONFIG="${DIRECTORY}/nebari-config.yaml" | ||
echo "config=${CONFIG}" | tee --append "${GITHUB_OUTPUT}" | ||
|
||
PROJECT='github-actions' | ||
echo "project=${PROJECT}" | tee --append "${GITHUB_OUTPUT}" | ||
|
||
DOMAIN='github-actions.nebari.dev' | ||
nslookup "${DOMAIN}" | ||
echo "domain=${DOMAIN}" | tee --append "${GITHUB_OUTPUT}" | ||
|
||
- shell: bash -l {0} | ||
id: init | ||
working-directory: ${{ steps.metadata.outputs.directory }} | ||
run: | | ||
nebari init local \ | ||
--project-name '${{ steps.metadata.outputs.project }}' \ | ||
--domain-name '${{ steps.metadata.outputs.domain }}' \ | ||
--auth-provider password \ | ||
--output '${{ steps.metadata.outputs.config }}' | ||
|
||
- shell: bash | ||
run: | | ||
# Update nebari config for CI | ||
|
||
# Change default JupyterLab theme | ||
cat >> '${{ steps.metadata.outputs.config }}' <<- EOM | ||
jupyterlab: | ||
default_settings: | ||
"@jupyterlab/apputils-extension:themes": | ||
theme: JupyterLab Dark | ||
EOM | ||
|
||
# Change default value for minio persistence size | ||
cat >> '${{ steps.metadata.outputs.config }}' <<- EOM | ||
monitoring: | ||
enabled: true | ||
overrides: | ||
minio: | ||
persistence: | ||
size: 1Gi | ||
EOM | ||
|
||
- shell: bash | ||
run: | | ||
# Display Nebari config | ||
cat '${{ steps.metadata.outputs.config }}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: setup-local | ||
description: "Setup runner for local deployment" | ||
|
||
inputs: | ||
kubectl-version: | ||
description: "Version of kubectl to install" | ||
required: false | ||
default: "1.19.16" | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- uses: azure/setup-kubectl@v4 | ||
with: | ||
version: v${{ inputs.kubectl-version }} | ||
|
||
- shell: bash | ||
run: | | ||
# Enable docker permissions for user | ||
sudo docker ps | ||
sudo usermod -aG docker $USER && newgrp docker | ||
|
||
docker info | ||
docker ps | ||
|
||
- shell: bash | ||
run: | | ||
# Get routing table for docker pods | ||
ip route |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: "Local Upgrade Tests" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- ".github/actions/**" | ||
- ".github/workflows/test_local_upgrade.yaml" | ||
release: | ||
types: | ||
- prereleased | ||
workflow_dispatch: | ||
|
||
|
||
concurrency: | ||
group: ${{ github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
NEBARI_IMAGE_TAG: "main" | ||
|
||
jobs: | ||
test-local-upgrade: | ||
runs-on: "cirun-runner--${{ github.run_id }}" | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup runner for local deployment | ||
uses: ./.github/actions/setup-local | ||
|
||
- name: Setup Python | ||
uses: conda-incubator/setup-miniconda@v3 | ||
env: | ||
CONDA: /home/runnerx/miniconda3 | ||
with: | ||
auto-update-conda: true | ||
python-version: "3.11" | ||
miniconda-version: "latest" | ||
|
||
- name: Install latest stable Nebari release | ||
run: pip install nebari | ||
|
||
- name: Initialize Nebari config for local deployment | ||
id: init | ||
uses: ./.github/actions/init-local | ||
|
||
- name: Extract old Nebari version | ||
run: | | ||
OLD_NEBARI_VERSION=$(grep 'nebari_version: ' ${{ steps.init.outputs.config }} | sed 's/nebari_version: //') | ||
echo "OLD_NEBARI_VERSION=${OLD_NEBARI_VERSION}" | tee --append "${GITHUB_ENV}" | ||
|
||
- name: Deploy Nebari | ||
working-directory: ${{ steps.init.outputs.directory }} | ||
run: nebari deploy --config ${{ steps.init.outputs.config }} --disable-prompt | ||
|
||
- name: Health check before upgrade | ||
id: health-check-before | ||
uses: ./.github/actions/health-check | ||
with: | ||
domain: ${{ steps.init.outputs.domain }} | ||
|
||
- name: Install current Nebari | ||
run: pip install --upgrade . | ||
|
||
- name: Upgrade Nebari config | ||
run: | | ||
git add --force ${{ steps.init.outputs.config }} | ||
nebari upgrade --config ${{ steps.init.outputs.config }} --attempt-fixes | ||
git diff | ||
nebari validate --config ${{ steps.init.outputs.config }} | ||
|
||
- name: Redeploy Nebari | ||
working-directory: ${{ steps.init.outputs.directory }} | ||
run: nebari deploy --config ${{ steps.init.outputs.config }} --disable-prompt | ||
|
||
- name: Health check after upgrade | ||
id: health-check-after | ||
uses: ./.github/actions/health-check | ||
with: | ||
domain: ${{ steps.init.outputs.domain }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing has changed functionally here. I factored out three things into local actions for them to be reusable by the upgrade test workflow: