Skip to content

Commit

Permalink
Upgrade Ubuntu agent version (#546)
Browse files Browse the repository at this point in the history
* Upgrade Ubuntu build agent to latest

Signed-off-by: Jean-Benoit Paux <[email protected]>

* Update kubeconfig file permissions

Signed-off-by: Jean-Benoit Paux <[email protected]>

* Clean old K3S 1.16 hack as it was removed

Signed-off-by: Jean-Benoit Paux <[email protected]>

* Removed unneeded sudo

Signed-off-by: Jean-Benoit Paux <[email protected]>

* Switched back to normal kubectl for MicroK8S since kubeconfig is copied

Signed-off-by: Jean-Benoit Paux <[email protected]>

* Update patch version

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

Signed-off-by: Jean-Benoit Paux <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jbpaux and github-actions[bot] authored Jan 3, 2023
1 parent 47b4258 commit 7d35269
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 89 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/run-test-cases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ on:

jobs:
build-containers:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:

test-cases:
needs: build-containers
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
timeout-minutes: 90

strategy:
Expand Down Expand Up @@ -172,24 +172,13 @@ jobs:
sudo curl -sfL https://get.k3s.io -o install.sh
sudo chmod +x install.sh
./install.sh server --kubelet-arg=eviction-hard="imagefs.available<1%,nodefs.available<1%" --kubelet-arg=eviction-minimum-reclaim="imagefs.available=1%,nodefs.available=1%"
sudo addgroup k3s-admin
sudo adduser $USER k3s-admin
sudo usermod -a -G k3s-admin $USER
sudo chgrp k3s-admin /etc/rancher/k3s/k3s.yaml
sudo chmod g+r /etc/rancher/k3s/k3s.yaml
sudo chmod 666 /etc/rancher/k3s/*
mkdir -p ~/.kube/ && cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
mkdir -p $HOME/.kube
sudo cp -i /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
echo "--set kubernetesDistro=k3s" > /tmp/k8s_distro_to_test.txt
echo 'kubectl' > /tmp/runtime_cmd_to_test.txt
echo '~/.kube/config' > /tmp/kubeconfig_path_to_test.txt
until kubectl get node ${HOSTNAME,,} -o jsonpath='{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status}' | grep 'Ready=True'; do echo "waiting for k3s to become ready"; sleep 10; done
if [ "${{ matrix.kube.runtime }}" == "K3s-1.16" ]; then
mkdir -p /var/lib/kubelet
if [ -d /var/lib/kubelet/device-plugins ]; then
sudo rm -rf /var/lib/kubelet/device-plugins
fi
sudo ln -s /var/lib/rancher/k3s/agent/kubelet/device-plugins /var/lib/kubelet/device-plugins
fi
- if: (startsWith(github.event_name, 'pull_request')) && (startsWith(matrix.kube.runtime, 'K3s'))
name: Import local agent and controller to K3s
Expand Down Expand Up @@ -226,10 +215,11 @@ jobs:
sudo sysctl --system
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo sed -i "s/SystemdCgroup = false/SystemdCgroup = true/g" /etc/containerd/config.toml
sudo systemctl restart containerd
sudo swapoff -a
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --cri-socket=/run/containerd/containerd.sock
sudo mkdir -p $HOME/.kube
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --cri-socket=unix:///run/containerd/containerd.sock
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Expand Down Expand Up @@ -278,17 +268,15 @@ jobs:
sudo snap install microk8s --classic --channel=${{ matrix.kube.version }}
sudo microk8s status --wait-ready
sudo usermod -a -G microk8s $USER
sudo ls -la $HOME/.kube
echo sudo chown $(id -u):$(id -g) $HOME/.kube
sudo chown -f -R $USER $HOME/.kube --verbose
sudo sh -c "microk8s.kubectl config view --raw >~/.kube/config"
sudo cat ~/.kube/config
mkdir -p $HOME/.kube
sudo microk8s.kubectl config view --raw > $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
sudo microk8s.enable rbac dns
sudo sed -i 's/memory.available<100Mi,nodefs.available<1Gi,imagefs.available<1Gi/memory.available<25Mi,nodefs.available<50Mi,imagefs.available<50Mi/' /var/snap/microk8s/current/args/kubelet
sudo systemctl restart snap.microk8s.daemon-kubelite
until sudo microk8s.status --wait-ready; do sleep 5s; echo "Try again"; done
echo '--set kubernetesDistro=microk8s' > /tmp/k8s_distro_to_test.txt
echo 'microk8s kubectl' > /tmp/runtime_cmd_to_test.txt
echo 'kubectl' > /tmp/runtime_cmd_to_test.txt
echo '~/.kube/config' > /tmp/kubeconfig_path_to_test.txt
- if: (startsWith(github.event_name, 'pull_request')) && (startsWith(matrix.kube.runtime, 'MicroK8s'))
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Get PR details
Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "agent"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>", "<[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "controller"
version = "0.9.0"
version = "0.9.1"
authors = ["<[email protected]>", "<[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.0
version: 0.9.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.9.0
appVersion: 0.9.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "debug-echo-discovery-handler"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "onvif-discovery-handler"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opcua-discovery-handler"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "udev-discovery-handler"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/debug-echo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-debug-echo"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/onvif/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-onvif"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/opcua/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-opcua"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/udev/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-udev"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion discovery-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-discovery-utils"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion samples/brokers/udev-video-broker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "udev-video-broker"
version = "0.9.0"
version = "0.9.1"
authors = ["Kate Goldenring <[email protected]>", "<[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
2 changes: 1 addition & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-shared"
version = "0.9.0"
version = "0.9.1"
authors = ["<[email protected]>"]
edition = "2018"
rust-version = "1.63.0"
Expand Down
Loading

0 comments on commit 7d35269

Please sign in to comment.