Skip to content

Commit

Permalink
Fix multinode CI (#19)
Browse files Browse the repository at this point in the history
* Fix multinode CI, fix review comments
  • Loading branch information
leshikus authored Jul 16, 2024
1 parent a9ce9e9 commit 6cff909
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 12 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/deploy-vagrant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,11 @@ jobs:
deploy:
runs-on:
- self-hosted
- libvirt-vagrant
- vagrant
steps:
- name: Checkout x1 repository
uses: actions/checkout@v4

- name: Checkout x1-cluster-profiles repository
uses: actions/checkout@v4
with:
repository: intel-sandbox/x1-cluster-profiles
path: x1-cluster-profiles
token: ${{ secrets.X1_GITHUB_TOKEN }}

- name: Deploy X1 to Vagrant VMs
run: ./scripts/ci/vagrant.sh

Expand Down
42 changes: 42 additions & 0 deletions icl-cluster-profiles/profiles/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Generated from Kapitan target ci

calico_endpoint_to_host_action: ACCEPT
calico_ipip_mode: Never
calico_network_backend: bird
calico_vxlan_mode: Never
containerd_use_config_path: true
dns_etchosts: '{{ ansible_default_ipv4.address }} {{ ingress_domain }}
{{ ansible_default_ipv4.address }} hub.{{ ingress_domain }}
{{ ansible_default_ipv4.address }} jupyter.{{ ingress_domain }}
{{ ansible_default_ipv4.address }} prefect.{{ ingress_domain }}
{{ ansible_default_ipv4.address }} ray.{{ ingress_domain }}
{{ ansible_default_ipv4.address }} registry.{{ ingress_domain }}
{{ ansible_default_ipv4.address }} s3.{{ ingress_domain }}
'
download_container: false
ingress_domain: localtest.me
kube_pods_subnet: 192.168.128.0/18
kube_service_addresses: 192.168.64.0/18
ntp_enabled: true
ntp_manage_config: true
vm_mode: true

# Overwrite default Terraform variables. Keeping this for compatibility with the older installation
# method. New method uses a dedicated terraform.tfvars file instead.
# For a complete list of variables and their default values see x1/terraform/variables.tf.
# Note that this variable is deprecated, use a generated "terraform.tfvars.json" instead.
terraform_tfvars: |
ingress_domain = "localtest.me"
prefect_api_url = "http://prefect.localtest.me/api"
jupyterhub_pre_puller_enabled = false
prometheus_enabled = false
kubernetes_dashboard_enabled = false
use_node_ip_for_user_ports = true
use_external_node_ip_for_user_ports = true
1 change: 0 additions & 1 deletion scripts/ci/init-multipass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ host_key_checking = False
EOF

# Fix ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
export LC_ALL="C.UTF-8"
locale

multipass launch --name "vm-$WORKFLOW_PREFIX_ID" -m "$VM_MEMORY"M -c "$VM_CPU" -d "$VM_DISK"G --cloud-init=./cloud-init.yaml rocky
Expand Down
3 changes: 2 additions & 1 deletion scripts/ci/init-vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ensure_vagrant_plugins() {
set_vagrant_env() {
export X1_LIBVIRT_DEFAULT_PREFIX="$WORKFLOW_PREFIX_ID"
export VAGRANT_DEFAULT_PROVIDER=libvirt
export VAGRANT_HOME=/.vagrant.d
}

vm_clean_before() {
Expand Down Expand Up @@ -62,6 +63,6 @@ vm_cleanup() {
vm_clean_before
}

ensure_vagrant_plugins
set_vagrant_env
ensure_vagrant_plugins

6 changes: 5 additions & 1 deletion scripts/ci/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
set -vx

set_env() {
echo "HOSTNAME: "$(hostname)
AGENT_ID=$(hostname | sed -e 's/.*[^0-9]//')
AGENT_ID=${AGENT_ID:-100}

Expand All @@ -15,7 +16,7 @@ set_env() {

WORKFLOW_PREFIX_ID="$WORKFLOW_PREFIX-$AGENT_ID"

X1_K8S_EXTRA_SETTINGS_FILE="$WORKSPACE_DIR/x1-cluster-profiles/profiles/ci.yaml"
X1_K8S_EXTRA_SETTINGS_FILE="$WORKSPACE_DIR/icl-cluster-profiles/profiles/ci.yaml"
no_proxy=localtest.me,.localtest.me,$no_proxy

VM_MEMORY=16384
Expand All @@ -30,6 +31,9 @@ set_env() {

echo "WORKFLOW_DIR: $WORKFLOW_DIR"
echo "X1_K8S_EXTRA_SETTINGS_FILE: $X1_K8S_EXTRA_SETTINGS_FILE"

export LC_ALL="C.UTF-8"
locale
}

run_kind() {
Expand Down
2 changes: 1 addition & 1 deletion vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Vagrant.configure(2) do |config|

config.vm.provider "libvirt" do |lv|
lv.driver = "kvm"
lv.storage_pool_name = "images"
lv.storage_pool_name = "default"
lv.default_prefix = "#{libvirt_default_prefix}-"
end

Expand Down

0 comments on commit 6cff909

Please sign in to comment.