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

[charm-dev] Install tox from pypi and other fixes #44

Merged
merged 1 commit into from
Mar 21, 2024
Merged
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
22 changes: 18 additions & 4 deletions v1/charm-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
# To create a VM similar to a GitHub-hosted runner:
# multipass launch --memory 7G --cpus 2 --name charm-dev-2cpu-7g charm-dev
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

#
# To only test the cloud init portion of this blueprint:
#
# yq '.instances."charm-dev"."cloud-init"."vendor-data"' v1/charm-dev.yaml > charm-dev-cloud-init.yaml
# multipass launch --cloud-init ./charm-dev-cloud-init.yaml --name test --memory 7G --cpus 2 --disk 30G

description: A development and testing environment for charmers
version: latest
Expand All @@ -28,22 +32,25 @@ instances:
cloud-init:
vendor-data: |
package_update: true
package_upgrade: true
package_reboot_if_required: true

packages:
- python3-pip
- jq
- sysstat
- zsh
- fzf
- tox
- bat
- ripgrep
- gnome-keyring
- kitty-terminfo

snap:
commands:
# Juju 3.1 is supported until 25.04
- snap install juju --channel=3.1/stable
- snap install microk8s --channel=1.27-strict/stable
- snap install microk8s --channel=1.28-strict/stable
- snap alias microk8s.kubectl kubectl
- snap alias microk8s.kubectl k
- snap install --classic charmcraft
Expand All @@ -56,6 +63,10 @@ instances:
- DEBIAN_FRONTEND=noninteractive apt -y upgrade
- DEBIAN_FRONTEND=noninteractive apt -y autoremove

- |
# Install tox from pypi (v4) instead of apt (v3)
sudo -u ubuntu pip install tox

- |
# disable swap
sysctl -w vm.swappiness=0
Expand Down Expand Up @@ -110,9 +121,11 @@ instances:
# The dns addon will restart the api server so you may see a blip in the availability
# Separating addons to avoid errors such as
# dial tcp 127.0.0.1:16443: connect: connection refused
microk8s.enable dns rbac
microk8s.enable dns
microk8s.kubectl rollout status deployments/coredns -n kube-system -w --timeout=600s

microk8s.enable rbac

townsend2010 marked this conversation as resolved.
Show resolved Hide resolved
# wait for storage become available
microk8s.enable hostpath-storage
microk8s.kubectl rollout status deployments/hostpath-provisioner -n kube-system -w --timeout=600s
Expand All @@ -134,6 +147,7 @@ instances:

# We need to connect the dot-local-share-juju interface with jhack
sudo snap connect jhack:dot-local-share-juju snapd
sudo snap connect jhack:ssh-read snapd

final_message: "The system is finally up, after $UPTIME seconds"

Expand Down
Loading