diff --git a/docs/source/admin_guide/argo-workflows.md b/docs/source/admin_guide/argo-workflows.md index f5baf5835b..aebf18e945 100644 --- a/docs/source/admin_guide/argo-workflows.md +++ b/docs/source/admin_guide/argo-workflows.md @@ -1,26 +1,18 @@ # Argo Workflows Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. Argo -workflows comes enabled by default with Qhub deployments. +workflows comes enabled by default with Nebari deployments. ## Accessing Argo Server -If Argo Workflows is enabled, users can access argo workflows server at: `your-qhub-domain.com/argo`. Log in via +If Argo Workflows is enabled, users can access argo workflows server at: `your-nebari-domain.com/argo`. Log in via Keycloak with your usual credentials. -Refer to the [Argo documentation](https://argoproj.github.io/argo-workflows/) for further details on Argo Workflows. - -## Submitting a workflow via Argo Server - -You can submit a workflow by clicking "SUBMIT NEW WORKFLOW" on the landing page. - -![See Argo Server Landing Page](../images/argo-server-landing-page.png) - ## Overrides of Argo Workflows Helm Chart values -Argo Workflows is deployed using Argo Workflows Helm Chart version 0.13.1. The values.yaml for the helm chart can be -overridden as needed via the overrides flag. The default values file can be found -[here](https://github.com/argoproj/argo-helm/blob/argo-workflows-0.13.1/charts/argo-workflows/values.yaml). For example, +Argo Workflows is deployed using the Argo Workflows Helm Chart. The values.yaml for the helm chart can be overridden as +needed via the overrides flag. The default values file can be found +[here](https://github.com/argoproj/argo-helm/blob/argo-workflows-0.22.9/charts/argo-workflows/values.yaml). For example, the following could be done to add additional environment variables to the controller container. ```yaml @@ -35,10 +27,12 @@ argo_workflows: ## Disabling Argo Workflows -To turn off the cluster monitoring on QHub deployments, simply turn off the feature flag within your `qhub-config.yaml` -file. For example: +To turn off the cluster monitoring on Nebari deployments, simply turn off the feature flag within your +`nebari-config.yaml` file. For example: ```yaml argo_workflows: enabled: false ``` + +Refer to the [Argo documentation](https://argoproj.github.io/argo-workflows/) for further details on Argo Workflows. diff --git a/docs/source/images/argo-workflows-user-tab.png b/docs/source/images/argo-workflows-user-tab.png new file mode 100644 index 0000000000..ac2a5df13c Binary files /dev/null and b/docs/source/images/argo-workflows-user-tab.png differ diff --git a/docs/source/user_guide/argo_workflows.md b/docs/source/user_guide/argo_workflows.md new file mode 100644 index 0000000000..a5c3da996c --- /dev/null +++ b/docs/source/user_guide/argo_workflows.md @@ -0,0 +1,32 @@ +# Argo Workflows + +Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. Argo +workflows comes enabled by default with Nebari deployments. + +## Accessing Argo Server + +If Argo Workflows is enabled, users can access argo workflows server at: `your-nebari-domain.com/argo`. Log in via +Keycloak with your usual credentials. + +## Submitting a Workflow via Argo Server + +You can submit a workflow by clicking "SUBMIT NEW WORKFLOW" on the landing page assuming you have the appropriate +permissions. + +![Argo Server Landing Page](../images/argo-server-landing-page.png) + +## Submitting a workflow via Argo CLI + +You can submit or manage workflows via the Argo CLI. The Argo CLI can be downloaded from the +[Argo Releases](https://github.com/argoproj/argo-workflows/releases) page. After downloading the CLI, you can get your +token from the Argo Server UI by clicking on the user tab in the bottom left corner and then clicking "Copy To +Clipboard". You'll need to make a few edits to access to what was copied for Argo CLI to work correctly. The base href +should be `ARGO_BASE_HREF=/argo` in the default nebari installation and you need to set the namespace where Argo was +deployed (dev by default) `ARGO_NAMESPACE=dev`. After setting those variables and the others copied from the Argo Server +UI, you can check that things are working by running `argo list`. + +![Argo Workflows User Tab](../images/argo-workflows-user-tab.png) + +## Additional Argo Workflows Resources + +Refer to the [Argo documentation](https://argoproj.github.io/argo-workflows/) for further details on Argo Workflows. diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/main.tf b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/main.tf index 39454774d6..ad45cee484 100644 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/main.tf +++ b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/main.tf @@ -8,12 +8,10 @@ resource "helm_release" "argo-workflows" { namespace = var.namespace repository = "https://argoproj.github.io/argo-helm" chart = "argo-workflows" - version = "0.13.1" + version = "0.22.9" values = concat([ file("${path.module}/values.yaml"), - # https://github.com/argoproj/argo-helm/blob/argo-workflows-0.13.1/charts/argo-workflows/values.yaml - jsonencode({ singleNamespace = true # Restrict Argo to operate only in a single namespace (the namespace of the Helm release) @@ -62,9 +60,6 @@ resource "helm_release" "argo-workflows" { "${var.node-group.key}" = var.node-group.value } } - controller = { - containerRuntimeExecutor = "emissary" - } }) ], var.overrides) @@ -180,9 +175,9 @@ resource "kubernetes_cluster_role_binding" "argo-admin-rb" { } } -resource "kubernetes_service_account" "argo-edit-sa" { +resource "kubernetes_service_account" "argo-dev-sa" { metadata { - name = "argo-edit" + name = "argo-dev" namespace = var.namespace annotations = { "workflows.argoproj.io/rbac-rule" : "'argo_developer' in groups" @@ -192,9 +187,9 @@ resource "kubernetes_service_account" "argo-edit-sa" { } } -resource "kubernetes_cluster_role_binding" "argo-edit-rb" { +resource "kubernetes_cluster_role_binding" "argo-dev-rb" { metadata { - name = "argo-edit" + name = "argo-dev" } role_ref { @@ -204,10 +199,12 @@ resource "kubernetes_cluster_role_binding" "argo-edit-rb" { } subject { kind = "ServiceAccount" - name = kubernetes_service_account.argo-edit-sa.metadata.0.name + name = kubernetes_service_account.argo-dev-sa.metadata.0.name namespace = var.namespace } } + + resource "kubernetes_service_account" "argo-view-sa" { metadata { name = "argo-view" diff --git a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/values.yaml b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/values.yaml index e507736647..4a82be8213 100644 --- a/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/values.yaml +++ b/nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/argo-workflows/values.yaml @@ -1 +1 @@ -# https://github.com/argoproj/argo-helm/blob/argo-workflows-0.13.1/charts/argo-workflows/values.yaml +# https://github.com/argoproj/argo-helm/blob/argo-workflows-0.22.9/charts/argo-workflows/values.yaml diff --git a/nebari/upgrade.py b/nebari/upgrade.py index f63d0cdd64..bba1495101 100644 --- a/nebari/upgrade.py +++ b/nebari/upgrade.py @@ -8,6 +8,7 @@ import rich from pydantic.error_wrappers import ValidationError +from rich.prompt import Prompt from .schema import is_version_accepted, verify from .utils import backup_config_file, load_yaml, yaml @@ -385,6 +386,31 @@ def _version_specific_upgrade( return config +class Upgrade_2023_4_2(UpgradeStep): + version = "2023.4.2" + + def _version_specific_upgrade( + self, config, start_version, config_filename: pathlib.Path, *args, **kwargs + ): + """ + Prompt users to delete Argo CRDs + """ + + kubectl_delete_argo_crds_cmd = "kubectl delete crds clusterworkflowtemplates.argoproj.io cronworkflows.argoproj.io workfloweventbindings.argoproj.io workflows.argoproj.io workflowtasksets.argoproj.io workflowtemplates.argoproj.io" + + rich.print( + f"\n\n[bold cyan]Note:[/] Upgrading requires a one-time manual deletion of the Argo Workflows Custom Resource Definitions (CRDs). \n\n[red bold]Warning: [link=https://{config['domain']}/argo/workflows]Workflows[/link] and [link=https://{config['domain']}/argo/workflows]CronWorkflows[/link] created before deleting the CRDs will be erased when the CRDs are deleted and will not be restored.[/red bold] \n\nThe updated CRDs will be installed during the next [cyan bold]nebari deploy[/cyan bold] step. Argo Workflows will not function after deleting the CRDs until the updated CRDs are installed in the next nebari deploy. You must delete the Argo CRDs before upgrading to {self.version} or deploy step will fail. Please delete them before proceeding by generating a kubeconfig (see [link=https://www.nebari.dev/docs/how-tos/debug-nebari/#generating-the-kubeconfig]docs[/link]), installing kubectl (see [link=https://www.nebari.dev/docs/how-tos/debug-nebari#installing-kubectl]docs[/link]), and running the following command:\n\n\t[cyan bold]{kubectl_delete_argo_crds_cmd} [/cyan bold]\n" + "" + ) + + continue_ = Prompt.ask("Have you deleted the Argo CRDs? \[y/N]", default="N") + if not continue_ == "y": + print(f"You must delete the Argo CRDs before upgrading to {self.version}") + exit() + + return config + + __rounded_version__ = ".".join([str(c) for c in rounded_ver_parse(__version__)]) # Manually-added upgrade steps must go above this line diff --git a/tests/test_upgrade.py b/tests/test_upgrade.py index fc20ac47d2..613c86da11 100644 --- a/tests/test_upgrade.py +++ b/tests/test_upgrade.py @@ -44,7 +44,11 @@ def test_upgrade_4_0( expect_upgrade_error, tmp_path, qhub_users_import_json, + monkeypatch, ): + # Return "y" when asked if you've deleted the Argo CRDs + monkeypatch.setattr("builtins.input", lambda: "y") + old_qhub_config_path = Path(__file__).parent / old_qhub_config_path_str tmp_qhub_config = Path(tmp_path, old_qhub_config_path.name)