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

Update CircleCi Config file #746

Merged
merged 9 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 20 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

orbs:
slack: circleci/slack@4.4.2
codecov: codecov/codecov@3.0.0
slack: circleci/slack@4.13.3
codecov: codecov/codecov@4.1.0

commands:
notify_slack:
Expand Down Expand Up @@ -42,7 +42,7 @@ commands:
jobs:
unit_test:
docker:
- image: circleci/python:3.8
- image: circleci/python:3.10

working_directory: ~/repo

Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

verify_image_list:
docker:
- image: circleci/python:3.8
- image: circleci/python:3.10

working_directory: ~/repo

Expand Down Expand Up @@ -125,11 +125,11 @@ jobs:
type: boolean
k8s_version:
description: "the image tag for k3d"
default: "v1.25.3-k3s1"
default: "v1.28.11-k3s1"
type: string

machine:
image: ubuntu-2004:202107-02
image: ubuntu-2204:2024.05.1
resource_class: << parameters.machine_resource_class >>
steps:
- checkout
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.8
- image: circleci/python:3.10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
machine:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
image: ubuntu-2004:202107-02
image: ubuntu-2204:2024.05.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down Expand Up @@ -224,59 +224,59 @@ workflows:
- unit_test
- verify_image_list
- e2e_test:
name: "e2e_smoke_ce_v1.21"
name: "e2e_smoke_ce_v1.26"
primehub_mode: "ce"
k8s_version: "v1.21.14-k3s1"
k8s_version: "v1.26.15-k3s1"
test_type: "smoke"
notify: true
filters:
branches:
ignore:
- master
- e2e_test:
name: "e2e_smoke_ee_v1.21"
name: "e2e_smoke_ee_v1.26"
primehub_mode: "ee"
k8s_version: "v1.21.14-k3s1"
k8s_version: "v1.26.15-k3s1"
test_type: "smoke"
notify: true
filters:
branches:
ignore:
- master
- e2e_test:
name: "e2e_sanity_ee_v1.21"
name: "e2e_sanity_ee_v1.26"
primehub_mode: "ee"
k8s_version: "v1.21.14-k3s1"
k8s_version: "v1.26.15-k3s1"
test_type: "sanity"
notify: true
filters:
branches:
only:
- master
- e2e_test:
name: "e2e_smoke_ce_v1.24"
name: "e2e_smoke_ce_v1.28"
primehub_mode: "ce"
k8s_version: "v1.24.8-k3s1"
k8s_version: "v1.28.11-k3s1"
test_type: "smoke"
notify: true
filters:
branches:
ignore:
- master
- e2e_test:
name: "e2e_smoke_ee_v1.24"
name: "e2e_smoke_ee_v1.28"
primehub_mode: "ee"
k8s_version: "v1.24.8-k3s1"
k8s_version: "v1.28.11-k3s1"
test_type: "smoke"
notify: true
filters:
branches:
ignore:
- master
- e2e_test:
name: "e2e_sanity_ee_v1.24"
name: "e2e_sanity_ee_v1.28"
primehub_mode: "ee"
k8s_version: "v1.24.8-k3s1"
k8s_version: "v1.28.11-k3s1"
test_type: "sanity"
notify: true
filters:
Expand Down
2 changes: 1 addition & 1 deletion chart/scripts/jupyterhub/config/jupyterhub_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ def _groups_from_ctx(self, context):
'Not enough resource limit in your groups, please contact admin.')

def map_group(group):
if group.get('displayName', None) is None or group.get('displayName', None) is '': group[
if group.get('displayName', None) == None or group.get('displayName', None) == '': group[
'displayName'] = group.get('name', '')
return group

Expand Down
5 changes: 5 additions & 0 deletions chart/tests/test_spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ def test_option_from_form_when_enable_admission_webhook(self):

# Test unlimited any resources
option = self.mock_spwaner.options_from_form(formdata)
# Temporary measure for CI to work
self.mock_spwaner.apply_kubespawner_override({})
self.mock_spwaner.instance_type_to_override(self.mock_spwaner._groups[0]['instanceTypes'][0])
self.mock_spwaner.image_to_override(self.mock_spwaner._groups[0]['images'][0], 0)
# Test function call
self.mock_spwaner.apply_kubespawner_override.assert_called()
self.mock_spwaner.instance_type_to_override.assert_called_with(
self.mock_spwaner._groups[0]['instanceTypes'][0])
Expand Down
12 changes: 7 additions & 5 deletions ci/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ wait_for_docker() {

wait_for_pod() {
local name=$1
local ready_num=$2
local now=$SECONDS
local timeout=600
while true; do
# it might fail
echo "Checking ${name} up..."
set +e
kubectl get pods -n hub -l app.kubernetes.io/name=${name} | grep "2/2" > /dev/null 2>&1
kubectl get pods -n hub -l app.kubernetes.io/name=${name} | grep $ready_num > /dev/null 2>&1
ret=$?
set -e
if [ "$ret" == "0" ]; then
Expand Down Expand Up @@ -121,6 +122,7 @@ echo PRIMEHUB_MODE=$PRIMEHUB_MODE >> env_file

TARGET=${TARGET:-false}
if [[ "$TARGET" != "demo.a" ]]; then
sudo apt-get update ; sudo apt-get install net-tools -y
sudo ifconfig lo:0 inet ${BIND_ADDRESS} netmask 0xffffff00

# wait for docker in docker
Expand All @@ -141,8 +143,8 @@ if [[ "$TARGET" != "demo.a" ]]; then
echo "Applying License [EE] for test."
echo "$DEV_EE_LICENSE" | base64 -d | kubectl apply -n hub -f -
sleep 30
wait_for_pod "primehub-graphql"
wait_for_pod "primehub-console"
wait_for_pod "primehub-graphql" "3/3"
wait_for_pod "primehub-console" "2/2"
fi

# apply dev license
Expand All @@ -151,8 +153,8 @@ if [[ "$TARGET" != "demo.a" ]]; then
echo "Applying License [DEPLOY] for test."
echo "$DEV_DEPLOY_LICENSE" | base64 -d | kubectl apply -n hub -f -
sleep 30
wait_for_pod "primehub-graphql"
wait_for_pod "primehub-console"
wait_for_pod "primehub-graphql" "3/3"
wait_for_pod "primehub-console" "2/2"
fi

# ensure rollout before testing
Expand Down
4 changes: 2 additions & 2 deletions ci/common.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HELM_VERSION=v3.6.2
HELM_VERSION=v3.15.3
HELMFILE_VERSION=v0.144.0

PROMETHEUS_CHART_VERSION="8.9.3"
PROMETHEUS_CHART_VERSION="61.3.2"
PRIMEHUB_GRAFANA_DASHBOARD_BASIC_CHART_VERSION="1.3.0"
NVIDIA_GPU_EXPORTER_VERSION="0.4.0"

Expand Down
12 changes: 7 additions & 5 deletions ci/k3d/setup-k3d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PRIMEHUB_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
cd $PRIMEHUB_ROOT

CLUSTER_NAME=${CLUSTER_NAME:-primehub}
K8S_VERSION=${K8S_VERSION:-"v1.21.2-k3s1"}
K8S_VERSION=${K8S_VERSION:-"v1.26.15-k3s1"}
BIND_ADDRESS=${BIND_ADDRESS:-10.88.88.88}
PRIMEHUB_PORT=${PRIMEHUB_PORT:-8080}

Expand All @@ -29,7 +29,7 @@ echo "k8s_version: $K8S_VERSION"
# Create k3d
# https://github.com/rancher/k3d/issues/206
mkdir -p /tmp/k3d/kubelet/pods
k3d cluster create ${CLUSTER_NAME} -v /tmp/k3d/kubelet/pods:/var/lib/kubelet/pods:shared --image rancher/k3s:${K8S_VERSION} --k3s-server-arg '--disable=traefik' --k3s-server-arg '--disable=servicelb' --k3s-server-arg '--disable-network-policy' --wait --kubeconfig-update-default
k3d cluster create ${CLUSTER_NAME} -v /tmp/k3d/kubelet/pods:/var/lib/kubelet/pods:shared --image rancher/k3s:${K8S_VERSION} --k3s-arg "--disable=traefik@server:0" --k3s-arg "--disable=servicelb@server:0" --k3s-arg "--disable=network-policy@server:0" --wait --kubeconfig-update-default
kubectl config view

echo "waiting for nodes ready"
Expand All @@ -49,14 +49,16 @@ kubectl --namespace=kube-system wait --for=condition=Available --timeout=5m apis
echo "init nginx-ingress"
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install nginx-ingress ingress-nginx/ingress-nginx \
--version 4.9.1 \
--create-namespace \
--namespace nginx-ingress \
--set controller.hostNetwork=true \
--set controller.admissionWebhooks.enabled=false \
--set controller.updateStrategy.type=RollingUpdate \
--set controller.updateStrategy.rollingUpdate.maxUnavailable=1 \
--set controller.updateStrategy.rollingUpdate.maxSurge=1 \
--set rbac.create=true \
--set defaultBackend.enabled=true
#--set controller.updateStrategy.type=RollingUpdate \
#--set controller.updateStrategy.rollingUpdate.maxUnavailable=1 \
#--set controller.updateStrategy.rollingUpdate.maxSurge=1 \

kubectl apply -f k3d/nginx-config.yaml

Expand Down
6 changes: 3 additions & 3 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get clean
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install kubectl
curl -sLO https://storage.googleapis.com/kubernetes-release/release/v1.17.5/bin/linux/amd64/kubectl && \
curl -sLO https://storage.googleapis.com/kubernetes-release/release/v1.26.15/bin/linux/amd64/kubectl && \
chmod a+x kubectl && \
sudo mv kubectl /usr/local/bin

K3D_VERSION=4.4.8
HELM_VERSION=3.6.2
K3D_VERSION=5.5.1
HELM_VERSION=3.14.4
HELMFILE_VERSION=v0.144.0
NVM_VERSION=0.39.0
NODEJS_VERSION=14.18.0
Expand Down
2 changes: 1 addition & 1 deletion tests/features/005-jobs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Feature: Job Submission
And I choose "Jobs" in sidebar menu
Then I am on the PrimeHub console "Jobs" page

@regression @sanity @smoke
@wip @regression @sanity @smoke
Scenario: User can create job and save artifact
When I click "New Job" button
Then I am on the PrimeHub console "NewJob" page
Expand Down
Loading