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

Wiab automation #728

Merged
merged 13 commits into from
Sep 10, 2024
Merged

Wiab automation #728

merged 13 commits into from
Sep 10, 2024

Conversation

jschumacher-wire
Copy link
Contributor

INGRESSNODE=$(d kubectl get pods -l app.kubernetes.io/name=ingress-nginx -o=custom-columns=NODE:.spec.nodeName --no-headers)
d kubectl cordon "$INGRESSNODE"

wget https://charts.jetstack.io/charts/cert-manager-v1.13.2.tgz
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason we manually download and unpack charts instead of using helm repo add?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Taken from https://github.com/wireapp/wire-server-deploy/blob/master/offline/docs_ubuntu_22.04.md

I guess the original thought was to avoid creating external dependencies for a "true" offline install, without internet. Which does not work anyway with (automated) demo WIAB, but I wanted to avoid upstreaming changes to the "official" offline documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this manual pulling of cert-manager helm chart in another pr and use our new helm-charts / wire-builds repo to put in the offline artifact.

Comment on lines +391 to +392
fi
if [ "$DO_SYSTEM_CLEANUP" = true ] && [ "$FORCE_REDEPLOY" = 0 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: is there a reason to avoid an else branch and instead duplicate the conditions in the following ifs?

Suggested change
fi
if [ "$DO_SYSTEM_CLEANUP" = true ] && [ "$FORCE_REDEPLOY" = 0 ]; then
elif [ "$FORCE_REDEPLOY" = 0 ]; then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The existing logic accounts for the case of a "clean" target system where no resource removal is necessary, in which we don't need to jump into the system_cleanup() function. Otherwise the output looks like this:

INFO: Target system clean, no previous wire-server-deploy installation found.

INFO: Cleaning up all VMs, docker resources and wire-server-deploy files on wiab-autodeploy.wire.link.

It's just cosmetics, but I's like to have consistent script output.

set -eo pipefail;

#cassandra
ufw allow 9042/tcp;
Copy link
Contributor

@lwille lwille Sep 2, 2024

Choose a reason for hiding this comment

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

thought: why do we use Ansible at all if we use imperative provisioning everywhere?

suggestion: use a suitable Ansible module to manage firewall rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The existing playbooks are supposed to take care of that AFAIK, which did not work reliably in the past - some deployments did have the rules applied, some did not.
I admit it's hacky, but it works reliably, and actual customer site deployments use their own networking / firewalling.

@amitsagtani97
Copy link
Contributor

amitsagtani97 commented Sep 3, 2024

While trying to run it locally for an installation, got the following error -

./autodeploy.sh --artifact-hash dc4dc2e2d3c70d2de6fcb956107224c82d4dfac5 --target-system wiab-test-box.wire.link

INFO: running local ansible playbook for inital server deployment.
INFO: This will setup up the Hetzner system with basic defaults, download and unpack the wire-server-deploy artifact.
/nix/store/x1xxsh1gp6y389hyl40a0i74dkxiprl7-bash-5.2-p15/bin/bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file or directory
ERROR: Ansible could not initialize the preferred locale: unsupported locale setting

@jschumacher-wire
Copy link
Contributor Author

While trying to run it locally for an installation, got the following error -

./autodeploy.sh --artifact-hash dc4dc2e2d3c70d2de6fcb956107224c82d4dfac5 --target-system wiab-test-box.wire.link

INFO: running local ansible playbook for inital server deployment.
INFO: This will setup up the Hetzner system with basic defaults, download and unpack the wire-server-deploy artifact.
/nix/store/x1xxsh1gp6y389hyl40a0i74dkxiprl7-bash-5.2-p15/bin/bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file or directory
ERROR: Ansible could not initialize the preferred locale: unsupported locale setting

Hmm I think that's a nix / ansible issue. I'm allready explicitly setting LC_ALL to UTF-8 here:
https://github.com/wireapp/wire-server-deploy/pull/728/files#diff-36ed65637f210713f6026a6b191f249cf1697bc0b9680da066cbdd36f32676abR140

There's more discussion here NixOS/nixpkgs#223151

--force-redeploy Force cleanup of previous Wire-in-a-box installation on target host
--artifact-hash String, specifies artifact ID as created here: https://github.com/wireapp/wire-server-deploy/actions/workflows/offline.yml
Defaults to 5c06158547bc57846eadaa2be5c813ec43be9b59
--target-system String, domain name used to access the target host
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good if this parameter contained the "domain" string somewhere, I initially expected it was like the OS version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I've renamed the --target-system flag to --target-domain.

Copy link

sonarqubecloud bot commented Sep 9, 2024

@jschumacher-wire jschumacher-wire merged commit 2e86366 into master Sep 10, 2024
4 of 5 checks passed
@jschumacher-wire jschumacher-wire deleted the wiab_automation branch September 10, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants