Skip to content
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

Nebari Typer CLI #1443

Merged
merged 47 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a122688
Initial typer CLI implmentation
Aug 29, 2022
eb8523f
edit logic
Aug 29, 2022
731bc14
Nebari cli: Add files _init.py and main.py (#1423)
asmijafar20 Sep 2, 2022
372fa85
Order CLI commands
Sep 7, 2022
a9fac68
Nebari typer cli commands (#1432)
asmijafar20 Sep 12, 2022
a445389
Nebari Render Command (#1433)
asmijafar20 Sep 13, 2022
c6142d0
Updates to init
Sep 16, 2022
9164c20
More work on init
Sep 18, 2022
6259384
Nebari deploy and destroy commands (#1436)
asmijafar20 Sep 19, 2022
d3a5877
Add guided-init
Sep 20, 2022
0d67af2
Add deploy flags and change repository default value (#1441)
asmijafar20 Sep 20, 2022
6a31dee
Nebari Typer CLI
asmijafar20 Sep 20, 2022
decb7b0
Add pre-commit
asmijafar20 Sep 20, 2022
9468910
Merge branch 'main' into typer_cli
iameskild Sep 20, 2022
4e66894
Add disable_checks in deploy command
asmijafar20 Sep 22, 2022
eafe6f5
Combine guided-init and init, part 1
Sep 22, 2022
fd6a227
Remove `dotenv` work. (#1472)
asmijafar20 Sep 24, 2022
8f93e4a
Merge branch 'typer_cli' of github.com:Quansight/qhub into typer_cli
Sep 26, 2022
a9ba966
guided-init clean up
Sep 27, 2022
0e15458
Merge branch 'main' into typer_cli
iameskild Sep 27, 2022
ecc5f65
Added `support`, `cost`, `upgrade` and `keycloak` commands. (#1468)
asmijafar20 Sep 27, 2022
5a771e4
clean up
Sep 27, 2022
28404e5
update help messages
Sep 27, 2022
3911f13
Update qhub/cli/_init.py
iameskild Sep 29, 2022
562a8fc
Update qhub/cli/_init.py
iameskild Sep 29, 2022
1ba974e
Merge branch 'main' into typer_cli
iameskild Oct 3, 2022
06d882b
Changes from review, part 1
Oct 3, 2022
20f09d4
Update qhub/cli/_init.py
iameskild Oct 3, 2022
62dcbfd
Update qhub/cli/_init.py
iameskild Oct 3, 2022
2abd34a
Update qhub/cli/_init.py
iameskild Oct 3, 2022
4c54317
Update qhub/cli/_init.py
iameskild Oct 3, 2022
580ad0b
Update qhub/cli/_init.py
iameskild Oct 3, 2022
3b33748
Update qhub/cli/_init.py
iameskild Oct 3, 2022
cd59e6d
Update qhub/cli/_init.py
iameskild Oct 3, 2022
05dcb8c
Update qhub/cli/main.py
iameskild Oct 3, 2022
fe4fb79
Changes from review, part 2
Oct 3, 2022
6b92168
Update env, clean up
Oct 3, 2022
44ef8df
Changes from review, part 3
Oct 3, 2022
edcb910
Minor update
Oct 3, 2022
4285ebf
Changes based review, part 4
Oct 3, 2022
8a5739c
more clean up
Oct 4, 2022
6ba50e6
Add `version` options to Nebari CLI (#1476)
asmijafar20 Oct 4, 2022
acfe29d
Change colour from blue1 to green and spring_green to blue
asmijafar20 Oct 4, 2022
3fbf044
Add suggested changes, Remove extra spaces
asmijafar20 Oct 4, 2022
54119a9
Add pre-commit
asmijafar20 Oct 4, 2022
089da20
change kubernetes msg
asmijafar20 Oct 6, 2022
11f6f3c
Update CI to use new nebari cli entrypoint (#1480)
iameskild Oct 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .github/workflows/kubernetes_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
with:
python-version: 3.8
miniconda-version: "latest"
- name: Install QHub
- name: Install Nebari
run: |
conda install -c anaconda pip
pip install .[dev]
- name: Download and Install Kind and Kubectl
- name: Download and Install Kubectl
run: |
mkdir -p bin
pushd bin
Expand All @@ -73,32 +73,32 @@ jobs:
ip route
- name: Add DNS entry to hosts
run: |
sudo echo "172.18.1.100 github-actions.qhub.dev" | sudo tee -a /etc/hosts
- name: Initialize QHub Cloud
sudo echo "172.18.1.100 github-actions.nebari.dev" | sudo tee -a /etc/hosts
- name: Initialize Nebari Cloud
run: |
mkdir -p local-deployment
cd local-deployment
qhub init local --project=thisisatest --domain github-actions.qhub.dev --auth-provider=password
nebari init local --project=thisisatest --domain github-actions.nebari.dev --auth-provider=password

# Need smaller profiles on Local Kind
sed -i -E 's/(cpu_guarantee):\s+[0-9\.]+/\1: 0.25/g' "qhub-config.yaml"
sed -i -E 's/(mem_guarantee):\s+[A-Za-z0-9\.]+/\1: 0.25G/g' "qhub-config.yaml"
sed -i -E 's/(cpu_guarantee):\s+[0-9\.]+/\1: 0.25/g' "nebari-config.yaml"
sed -i -E 's/(mem_guarantee):\s+[A-Za-z0-9\.]+/\1: 0.25G/g' "nebari-config.yaml"

cat qhub-config.yaml
- name: Deploy QHub Cloud
cat nebari-config.yaml
- name: Deploy Nebari
run: |
cd local-deployment
qhub deploy --config qhub-config.yaml --disable-prompt
nebari deploy --config nebari-config.yaml --disable-prompt
- name: Basic kubectl checks after deployment
if: always()
run: |
kubectl get all,cm,secret,ing -A
- name: Check github-actions.qhub.dev resolves
- name: Check github-actions.nebari.dev resolves
run: |
nslookup github-actions.qhub.dev
nslookup github-actions.nebari.dev
- name: Curl jupyterhub login page
run: |
curl -k https://github-actions.qhub.dev/hub/home -i
curl -k https://github-actions.nebari.dev/hub/home -i

### CYPRESS TESTS
- name: Setup Node
Expand All @@ -113,8 +113,8 @@ jobs:
sudo apt-get -y update
sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

- name: Get qhub-config.yaml full path
run: echo "QHUB_CONFIG_PATH=`realpath ./local-deployment/qhub-config.yaml`" >> "$GITHUB_ENV"
- name: Get nebari-config.yaml full path
run: echo "NEBARI_CONFIG_PATH=`realpath ./local-deployment/nebari-config.yaml`" >> "$GITHUB_ENV"

- name: Create example-user
run: |
Expand All @@ -124,13 +124,13 @@ jobs:
echo "CYPRESS_EXAMPLE_USER_NAME=${CYPRESS_EXAMPLE_USER_NAME}" >> $GITHUB_ENV
echo "CYPRESS_EXAMPLE_USER_PASSWORD=${CYPRESS_EXAMPLE_USER_PASSWORD}" >> $GITHUB_ENV

qhub keycloak --config "${QHUB_CONFIG_PATH}" adduser "${CYPRESS_EXAMPLE_USER_NAME}" "${CYPRESS_EXAMPLE_USER_PASSWORD}"
qhub keycloak --config "${QHUB_CONFIG_PATH}" listusers
nebari keycloak adduser --user "${CYPRESS_EXAMPLE_USER_NAME}" "${CYPRESS_EXAMPLE_USER_PASSWORD}" --config "${NEBARI_CONFIG_PATH}"
nebari keycloak listusers --config "${NEBARI_CONFIG_PATH}"

- name: Cypress run
uses: cypress-io/github-action@v2
env:
CYPRESS_BASE_URL: https://github-actions.qhub.dev/
CYPRESS_BASE_URL: https://github-actions.nebari.dev/
with:
working-directory: tests_e2e

Expand All @@ -155,15 +155,15 @@ jobs:
run: |
export JUPYTERHUB_USERNAME=${CYPRESS_EXAMPLE_USER_NAME}
export JUPYTERHUB_PASSWORD=${CYPRESS_EXAMPLE_USER_PASSWORD}
jhubctl --verbose run --hub=https://github-actions.qhub.dev \
jhubctl --verbose run --hub=https://github-actions.nebari.dev \
--auth-type=keycloak \
--validate --no-verify-ssl \
--kernel python3 \
--stop-server \
--notebook tests_deployment/assets/notebook/simple.ipynb \

### CLEANUP AFTER TESTS
- name: Cleanup qhub deployment
- name: Cleanup nebari deployment
run: |
cd local-deployment
qhub destroy --config qhub-config.yaml
nebari destroy --config nebari-config.yaml --disable-prompt
24 changes: 12 additions & 12 deletions .github/workflows/test-provider.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test QHub Provider"
name: "Test Nebari Provider"

on:
pull_request:
Expand Down Expand Up @@ -36,7 +36,7 @@ env:

jobs:
test-render-providers:
name: 'Test QHub Provider'
name: 'Test Nebari Provider'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -75,19 +75,19 @@ jobs:
- name: Use az CLI
if: ${{ matrix.provider == 'azure' }}
run: az version
- name: Install QHub
- name: Install Nebari
run: |
pip install .[dev]
- name: QHub Initialize
- name: Nebari Initialize
run: |
qhub init "${{ matrix.provider }}" --project "TestProvider" --domain "${{ matrix.provider }}.qhub.dev" --auth-provider github --disable-prompt --ci-provider ${{ matrix.cicd }}
cat "qhub-config.yaml"
- name: QHub Render
nebari init "${{ matrix.provider }}" --project "TestProvider" --domain "${{ matrix.provider }}.nebari.dev" --auth-provider github --disable-prompt --ci-provider ${{ matrix.cicd }}
cat "nebari-config.yaml"
- name: Nebari Render
run: |
qhub render -c "qhub-config.yaml" -o "qhub-${{ matrix.provider }}-${{ matrix.cicd }}-deployment"
cp "qhub-config.yaml" "qhub-${{ matrix.provider }}-${{ matrix.cicd }}-deployment/qhub-config.yaml"
- name: QHub Render Artifact
nebari render -c "nebari-config.yaml" -o "nebari-${{ matrix.provider }}-${{ matrix.cicd }}-deployment"
cp "nebari-config.yaml" "nebari-${{ matrix.provider }}-${{ matrix.cicd }}-deployment/nebari-config.yaml"
- name: Nebari Render Artifact
uses: actions/upload-artifact@master
with:
name: "qhub-${{ matrix.provider }}-${{ matrix.cicd }}-artifact"
path: "qhub-${{ matrix.provider }}-${{ matrix.cicd }}-deployment"
name: "nebari-${{ matrix.provider }}-${{ matrix.cicd }}-artifact"
path: "nebari-${{ matrix.provider }}-${{ matrix.cicd }}-deployment"
5 changes: 5 additions & 0 deletions environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ dependencies:
- bcrypt
- python-kubernetes
- rich
- typer
- pip
- pip:
- questionary
# dev dependencies
- flake8 ==3.8.4
- black ==22.3.0
- importlib-metadata<5.0
- twine
- pytest
- diagrams
Expand Down
Loading