Skip to content

Fix demo bundle deployment #776

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

Merged
merged 72 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ff095d3
WPB-16190: add/fix demo values for all the required helm charts
mohitrajain Apr 28, 2025
b41a637
WPB-16190: disolve stackIT directory, move files to ansible and bin i…
mohitrajain Apr 28, 2025
b0adbed
WPB-16190: updated stacKIT-wiab document, updated offline_deploy_k8s …
mohitrajain Apr 28, 2025
4fb86ff
WPB-16190: modified vm-setup playbook, to move away from external dat…
mohitrajain Apr 28, 2025
7ca149f
WPB-16190: create a patch to fix the gpg expired keys issue in the la…
mohitrajain Apr 28, 2025
727e9ee
WPB-16190: fix the linting issues [skip ci]
mohitrajain Apr 28, 2025
c069dc1
WPB-16190: fix background-worker values to make it use ephemeral storage
mohitrajain Apr 29, 2025
ffe4c2a
WPB-16190: fix processing of secrets from demo-secrets, simplify depl…
mohitrajain Apr 29, 2025
8ee62ac
WPB-16190: re-implement offline-secrets to work with demo/prod-secret…
mohitrajain Apr 29, 2025
2804e52
WPB-16190: enable check for dns records and use one var target_domain…
mohitrajain Apr 30, 2025
37536b2
WPB-16190: extend setup-offline-sources playbook to work on remote sr…
mohitrajain May 6, 2025
27c2adc
WPB-16190: extend seed-offline-containerd playbook to fix docker user…
mohitrajain May 6, 2025
f7235d5
WPB-16190: add group_vars for demo offline targets to provide vars us…
mohitrajain May 6, 2025
ec77580
WPB-16190: made update-kicbase-gpg-keys playbook more idempotent
mohitrajain May 6, 2025
3a5f6a1
WPB-16190: remove script setup_hosts and replaced it with import_play…
mohitrajain May 6, 2025
ce52968
WPB-16190: remove commands to run the functions and instead allow it …
mohitrajain May 6, 2025
ea0143f
WPB-16190: update artifact to use demo bundle, fix inter-dependency b…
mohitrajain May 6, 2025
35d5ca2
WPB-16190: clean demo artifact as debs-jammy is not required, binarie…
mohitrajain May 6, 2025
08a942e
WPB-16190: merge master
mohitrajain May 6, 2025
a14ba0a
WPB-16190: fix lint issue
mohitrajain May 6, 2025
89baa46
WPB-16190: fix the json files copy reference for demo bundle
mohitrajain May 7, 2025
213a29c
WPB-16190: add conditions in seed-offline-containerd to skip seeding …
mohitrajain May 7, 2025
3c246a3
WPB-16190: fix values for demo-smtp chart
mohitrajain May 7, 2025
f7ba8d5
WPB-16190: fix offline_deploy_k8s.sh to make process_charts more generic
mohitrajain May 7, 2025
5acaf3f
WPB-16190: defined deploy_node in inventory, stop using setup-offline…
mohitrajain May 7, 2025
9c1d268
WPB-16190: update the artifact hash to last verified commit [skip ci]
mohitrajain May 7, 2025
3102ce2
WPB-16190: import all vars from vm-setup.yml to host.yml to manage on…
mohitrajain May 9, 2025
c8a99ef
WPB-16190: break vm-setup.yml into smaller individual playbooks
mohitrajain May 9, 2025
7164236
WPB-16190: replace vm-setup.yml with deploy_wiab.yml with import_play…
mohitrajain May 9, 2025
c86155c
WPB-16190: moved pre_clean_values-1.sh to tasks directory to make it …
mohitrajain May 9, 2025
e888382
WPB-16190: process all charts natively while bundling demo instead of…
mohitrajain May 9, 2025
563bef6
WPB-16190: fix offline.yml gitlab runner to clean default profile and…
mohitrajain May 9, 2025
ab6ce31
WPB-16190: fix example.com node value in inventory host.yml
mohitrajain May 9, 2025
0d15389
WPB-16190: fix TASKS_DIR variable for demo profile and change build p…
mohitrajain May 10, 2025
47f242a
WPB-16190: fix archeive path for demo bundle
mohitrajain May 11, 2025
7b23334
WPB-16190: remove non-required playbooks from wiab-demo
mohitrajain May 11, 2025
be070e4
WPB-16190: fix security suggestions[skip ci]
mohitrajain May 12, 2025
b26a026
WPB-16190: move demo inventory file to ansible/inventory/demo and rem…
mohitrajain May 16, 2025
61fcdee
WPB-16190: increase timeout while seeding
mohitrajain May 16, 2025
39d61cd
WPB-16190: add blocks and when statements to control the flow in setu…
mohitrajain May 16, 2025
412755e
WPB-16190: reduce sftd-join-call deployment pods to 1
mohitrajain May 16, 2025
adbb363
WPB-16190: fix helm_install to have WSD definition and define all the…
mohitrajain May 16, 2025
ecc19dd
WPB-16190: remove extra pkgs and added a block to allow for when cond…
mohitrajain May 16, 2025
28d9628
WPB-16190: iptables_rules - add comments, allow for saving and restor…
mohitrajain May 16, 2025
50398f2
WPB-16190: minikube- add profile to seggregate from defaultdeployment…
mohitrajain May 16, 2025
b22432c
WPB-16190: ssh_keys - make unique keys for wire-deployment and added …
mohitrajain May 16, 2025
7f9449e
WPB-16190: add extra common tasks to identify k8s node names and inst…
mohitrajain May 16, 2025
726ae55
WPB-16190: handle k8s node names from ansible playbook and add a fall…
mohitrajain May 16, 2025
4866420
WPB-16190: add playbooks for cleaning cluster and verifying the host …
mohitrajain May 16, 2025
40913a8
WPB-16190: fix setup-offline-deploy playbook and its vars, remove ass…
mohitrajain May 21, 2025
167a405
WPB-16190: fix logic to find an IP for wire ingress
mohitrajain May 21, 2025
286d77a
WPB-16190: fix when conditions for clean_cluster
mohitrajain May 21, 2025
07e0f9b
WPB-16190: add comments for to-do tasks
mohitrajain May 21, 2025
214cc81
WPB-16190: fix issues with setup-offline-sources, add option for ansi…
mohitrajain May 21, 2025
e0d615f
Merge branch 'master' into fix-min-deployment
mohitrajain May 21, 2025
3dc1bfe
WPB-16190: add documentation for demo-wiab deployment and updated art…
mohitrajain May 21, 2025
71cee20
WPB-16190: fix setup-offline-sources pipeline to always unarchieve he…
mohitrajain May 22, 2025
e15e159
WPB-16190: fix documentation for demo-wiab document and point stackIT…
mohitrajain May 22, 2025
42a36be
WPB-16190: fix documentation for demo-wiab document and a minor fix f…
mohitrajain May 22, 2025
d7655f4
WPB-16190: a minor fix for verify-wire-ip
mohitrajain May 23, 2025
be21fc0
WPB-16190: update document for iptables rules state post reboot [skip…
mohitrajain May 23, 2025
56b1ccc
WPB-16190: update offline_deploy_k8s script to correctly update turn IPs
mohitrajain May 23, 2025
b706b30
WPB-16190: keeping default s3 creds same in demo deployment
mohitrajain May 23, 2025
840692f
WPB-16190: fix clean_cluster logic for minikube and helm_install for …
mohitrajain May 23, 2025
4fb78af
WPB-16190: modify ssh_public_key addition logic for minikube nodes
mohitrajain May 23, 2025
6165e0d
WPB-16190: update artifact for latest working commits and update docu…
mohitrajain May 23, 2025
5f24521
WPB-16190: update documents for demo-wiab [skip ci]
mohitrajain May 26, 2025
17a03cf
WPB-16190: update documents for demo-wiab [skip ci]
mohitrajain May 27, 2025
385efe2
WPB-16190: fix serviceName for s3 service in nginx-ingress-services h…
mohitrajain May 27, 2025
6906058
Merge branch 'master' into fix-min-deployment
mohitrajain May 27, 2025
1a69709
WPB-16190: fix demo-build pipeline
mohitrajain May 27, 2025
44fa6b0
WPB-16190: update artifact for demo deployment [skip ci]
mohitrajain May 27, 2025
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
41 changes: 19 additions & 22 deletions .github/workflows/offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ jobs:
echo ::set-output name=UPLOAD_NAME::$GITHUB_SHA
# echo ::set-output name=UPLOAD_NAME::${SOURCE_TAG:-$GITHUB_SHA}

# demo profile build
- name: Process the demo profile build
run: ./offline/demo-build/build.sh
env:
GPG_PRIVATE_KEY: '${{ secrets.GPG_PRIVATE_KEY }}'
DOCKER_LOGIN: '${{ secrets.DOCKER_LOGIN }}'

- name: Copy demo build assets tarball to S3 and clean up
run: |
# Upload tarball for each profile by specifying their OUTPUT_TAR path
aws s3 cp offline/demo-build/output/assets.tgz s3://public.wire.com/artifacts/wire-server-deploy-static-demo-${{ steps.upload_name.outputs.UPLOAD_NAME }}.tgz
echo "Uploaded to: https://s3-$AWS_REGION.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-demo-${{ steps.upload_name.outputs.UPLOAD_NAME }}.tgz"
# remove the assets from the build to optimize the space on the server
rm -rf offline/demo-build/output/*
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
AWS_REGION: "eu-west-1"

# min profile build
- name: Process the min profile build
run: ./offline/min-build/build.sh
Expand Down Expand Up @@ -63,27 +82,6 @@ jobs:
# Upload tarball for each profile by specifying their OUTPUT_TAR path
aws s3 cp offline/default-build/output/assets.tgz s3://public.wire.com/artifacts/wire-server-deploy-static-${{ steps.upload_name.outputs.UPLOAD_NAME }}.tgz
echo "Uploaded to: https://s3-$AWS_REGION.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-${{ steps.upload_name.outputs.UPLOAD_NAME }}.tgz"
# remove the archives from the build to optimize the space on the server
rm offline/default-build/output/containers-helm.tar
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
AWS_REGION: "eu-west-1"

# demo profile build
- name: Process the demo profile build
run: ./offline/demo-build/build.sh
env:
GPG_PRIVATE_KEY: '${{ secrets.GPG_PRIVATE_KEY }}'
DOCKER_LOGIN: '${{ secrets.DOCKER_LOGIN }}'

- name: Copy demo build assets tarball to S3 and clean up
run: |
# Upload tarball for each profile by specifying their OUTPUT_TAR path
aws s3 cp offline/demo-build/output/assets.tgz s3://public.wire.com/artifacts/wire-server-deploy-static-demo-${{ steps.upload_name.outputs.UPLOAD_NAME }}.tgz
echo "Uploaded to: https://s3-$AWS_REGION.amazonaws.com/public.wire.com/artifacts/wire-server-deploy-static-demo-${{ steps.upload_name.outputs.UPLOAD_NAME }}.tgz"
# remove the assets from the build to optimize the space on the server
rm -rf offline/demo-build/output/*
# removing everything except assets.tgz as it is not required anymore in the further builds
find offline/default-build/output/ -mindepth 1 -maxdepth 1 ! -name 'assets.tgz' -exec rm -r {} +
env:
Expand Down Expand Up @@ -117,4 +115,3 @@ jobs:
run: (cd terraform/examples/wire-server-deploy-offline-hetzner ; terraform init && terraform destroy -auto-approve)
env:
HCLOUD_TOKEN: '${{ secrets.HCLOUD_TOKEN }}'

65 changes: 65 additions & 0 deletions ansible/inventory/demo/host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
wiab:
hosts:
deploy_node:
ansible_host: example.com
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
ansible_user: 'ubuntu'
ansible_ssh_private_key_file: "~/.ssh/wiab-demo.pem"

vars:
# requirements
# ubuntu 24.04
# amd64 architecture
# Following ports to be available on it from stack-it guide
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Following ports to be available on it from stack-it guide
# The list of ports in the stack-it guide must be available.


# it should have all dns records configured as per DNS requirements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# it should have all dns records configured as per DNS requirements
#you should have all of the dns records of the given domain configured as per the DNS requirements at:

# https://docs.wire.com/latest/how-to/install/includes/helm_dns-ingress-troubleshooting.inc.html
target_domain: "example.com"

# define this variable in case, deploying it in a private network
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# define this variable in case, deploying it in a private network
# define this variable in case you are deploying wire on a private network, for local users only.

# specify the external (Gateway) IP of the network where the deploy_node is present
# by default, public ip address attached to the node will be used, if accessible over test_port in verify_wire_ip playbook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# by default, public ip address attached to the node will be used, if accessible over test_port in verify_wire_ip playbook
# by default, the public ip address attached directly to the target will be used, if it is accessible over test_port in verify_wire_ip playbook

wire_ip: ""

# artifact_hash
artifact_hash: "83c373394ff86ec4c96e110e327fc46b617c22ff"

# docker vars
docker_ce_version: "5:28.1.1-1~ubuntu.24.04~noble"
containerd_version: "1.7.27-1"

# minikube vars
minikube_profile: "k8s-wire"
minikube_version: "v1.35.0"
kubernetes_version: "v1.28.2"
container_runtime: "containerd"
minikube_nodes: 1
minikube_cpus: 15
minikube_memory: "16384"
minikube_disk_size: "200g"
minikube_network_name: "minikube-wire-network"
pod_network_cidr: "10.233.0.0/16"
minikube_node_subnet: "192.168.99.0/24"

# networking iptables dnat rules
http_dnat_rules:
- { protocol: "tcp", port: 443, to_port: 31773 }
- { protocol: "tcp", port: 80, to_port: 31772 }
turn_dnat_rules:
- { protocol: "tcp", port: 3478, to_port: 3478 }
- { protocol: "udp", port: 3478, to_port: 3478 }

# list of helm charts to deploy
charts_to_deploy:
- fake-aws
- demo-smtp
- rabbitmq
- databases-ephemeral
- reaper
- wire-server
- webapp
- account-pages
- team-settings
- smallstep-accomp
- ingress-nginx-controller
- nginx-ingress-services
50 changes: 0 additions & 50 deletions ansible/inventory/demo/hosts.example.ini

This file was deleted.

28 changes: 28 additions & 0 deletions ansible/inventory/offline/group_vars/demo/offline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The assethost will host assets other machines will download
# this will be passed post adding the assethost node in the playbook
# assethost_host: "{{ hostvars['assethost'].ansible_host }}:8080"
# When set to true; will set up all the repos below before continuing
# to bootstrap; such that no network access is needed
offline: true

# This is used nowhere inside kubespray, only inside this file
# and our own playbooks
ubuntu_repos: "http://{{ assethost_host }}/debs-{{ ansible_distribution_release }}/public"
ubuntu_repo_base_url: "{{ ubuntu_repos }}"
ubuntu_repo_gpgkey: "{{ ubuntu_repos }}/gpg"

docker_ubuntu_repo_base_url: "{{ ubuntu_repos }}"
docker_ubuntu_repo_gpgkey: "{{ ubuntu_repos }}/gpg"
# docker_ubuntu_repo_repokey: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88"

binaries_url: "http://{{ assethost_host }}/binaries"

kubeconfig_localhost: true
#resolvconf_mode: none

# This defaults to true if http://169.254.169.254/latest/meta-data exists; which
# is also available in non-AWS. e.g. in Hetzner. Lets not let this autodetect in offline
is_aws_environment: False

# IP address for the logging (for example QRadar) server
syslog_target_ip: 12.34.56.78
36 changes: 36 additions & 0 deletions ansible/seed-offline-containerd.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
- name: Fix containerd socker permission
hosts: k8s-cluster
tasks:
# useful for minikube setup as docker user doesn't have permissions to access to the socket
- name: Ensure containerd socket has correct permissions for docker user
file:
path: /run/containerd/containerd.sock
owner: root
group: docker
mode: '0660'
become: yes
when: docker_permission_fix | default(false) == true

- name: Seed system containers
# Add etcd group here if you are deploying separate worker and master clusters
hosts: k8s-cluster
Expand All @@ -8,6 +21,19 @@
for container in $(curl -q {{ assethost_host }}/containers-system/index.txt);do
curl -q "{{ assethost_host }}/containers-system/$container" | ctr -n=k8s.io images import -
done
register: load_containers
async: 3600
poll: 0
when: skip_seed_system_containers | default(false) == false

- name: Waiting on async task load_containers
async_status:
jid: "{{ load_containers.ansible_job_id }}"
register: res
until: res.finished
retries: 60
delay: 60
when: skip_seed_system_containers | default(false) == false

- name: Download helm containers
hosts: k8s-cluster
Expand All @@ -19,7 +45,17 @@
curl -q "{{ assethost_host }}/containers-helm/$container" | ctr -n=k8s.io images import -
done

register: load_helm_containers
async: 3600
poll: 0

- name: Waiting on async task load_helm_containers
async_status:
jid: "{{ load_helm_containers.ansible_job_id }}"
register: res
until: res.finished
retries: 60
delay: 60
################################### Hack to tag the ingress-nginx container images ###############
#- name: Load ingress-controller containers
# hosts: k8s-cluster
Expand Down
95 changes: 59 additions & 36 deletions ansible/setup-offline-sources.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,83 @@
- name: Copy over binaries, debs and container images to the asset host and host them
hosts: assethost
become: yes
vars:
src_path: ".." # Default value for src_path
remote_src: no
tasks:
- file:
path: /opt/assets
state: directory

- name: Copy debs jammy
unarchive:
src: ../debs-jammy.tar
src: "{{ src_path }}/debs-jammy.tar"
dest: /opt/assets
remote_src: "{{ remote_src }}"
tags:
- debs
when: demo_deploy | default(false) == false

- name: Copy binaries
unarchive:
src: ../binaries.tar
src: "{{ src_path }}/binaries.tar"
dest: /opt/assets
remote_src: "{{ remote_src }}"
tags:
- binaries
when: demo_deploy | default(false) == false

- name: Copy system containers
unarchive:
src: ../containers-system.tar
src: "{{ src_path }}/containers-system.tar"
dest: /opt/assets
remote_src: "{{ remote_src }}"
tags:
- containers-system
- containers
when: demo_deploy | default(false) == false

# this task needs to run everytime, we assume it a basic requirement in all types of deployment
- name: Copy helm containers
unarchive:
src: ../containers-helm.tar
src: "{{ src_path }}/containers-helm.tar"
dest: /opt/assets
remote_src: "{{ remote_src }}"
tags:
- containers-helm
- containers
- copy:
src: files/serve-assets.service
dest: /etc/systemd/system/serve-assets.service
- systemd:
name: serve-assets
state: restarted
enabled: yes
daemon-reload: yes

- name: setup serve-assets
block:
- name: Copy serve-assets.service file
copy:
src: files/serve-assets.service
dest: /etc/systemd/system/serve-assets.service
- name: Running serve-assets systemd service
systemd:
name: serve-assets
state: restarted
enabled: yes
daemon-reload: yes

- name: Set up offline repositories and remove online ones
become: yes
hosts: k8s-cluster:etcd:cassandra:elasticsearch:minio:rmq-cluster
tasks:
- name: Bail if GPG is not installed or installable.
apt:
name: gpg
state: present
- name: Remove /etc/apt/sources.list to remove all online debian package repos
file:
path: /etc/apt/sources.list
state: absent
- name: Remove /etc/apt/sources.list.d/ to remove all online debian package repos
file:
path: /etc/apt/sources.list.d/
state: absent
- when: demo_deploy | default(false) == false
block:
- name: Bail if GPG is not installed or installable.
apt:
name: gpg
state: present
- name: Remove /etc/apt/sources.list to remove all online debian package repos
file:
path: /etc/apt/sources.list
state: absent
- name: Remove /etc/apt/sources.list.d/ to remove all online debian package repos
file:
path: /etc/apt/sources.list.d/
state: absent

#######################################################################
# If your offline repo's debian key has expired, uncomment this block.
Expand All @@ -75,16 +99,15 @@
#############################
# Otherwise, trust the repo.
#############################
- name: Register offline repo key
apt_key:
url: "{{ ubuntu_repo_gpgkey }}"
state: present

- name: Register offline repo
apt_repository:
repo: "deb {{ ubuntu_repo_base_url }} {{ ansible_distribution_release }} main"
state: present
- name: Apt update
apt:
update_cache: yes
- name: Register offline repo key
apt_key:
url: "{{ ubuntu_repo_gpgkey }}"
state: present

- name: Register offline repo
apt_repository:
repo: "deb {{ ubuntu_repo_base_url }} {{ ansible_distribution_release }} main"
state: present
- name: Apt update
apt:
update_cache: yes
Loading