From 39903cd8bfda158891085bdb44624e311365c10e Mon Sep 17 00:00:00 2001 From: Alex Collins <alex_collins@intuit.com> Date: Fri, 24 Jan 2020 09:25:03 -0800 Subject: [PATCH 1/3] fix: nil pointer in GC --- .circleci/config.yml | 8 + Makefile | 27 +- hack/update-manifests.sh | 1 + manifests/quick-start-no-db.yaml | 409 +++++++++++++++++ manifests/quick-start-none.yaml | 1 + .../quick-start/no-db/kustomization.yaml | 8 + .../workflow-controller-configmap.yaml | 18 + test/e2e/argo_server_test.go | 24 +- test/e2e/cli_test.go | 3 + test/e2e/fixtures/persistence.go | 57 ++- test/e2e/manifests/no-db.yaml | 433 ++++++++++++++++++ test/e2e/manifests/no-db/kustomization.yaml | 19 + .../overlays/argo-server-deployment.yaml | 23 + .../workflow-controller-deployment.yaml | 31 ++ workflow/controller/config_controller.go | 2 +- 15 files changed, 1031 insertions(+), 33 deletions(-) create mode 100644 manifests/quick-start-no-db.yaml create mode 100644 manifests/quick-start-none.yaml create mode 100644 manifests/quick-start/no-db/kustomization.yaml create mode 100644 manifests/quick-start/no-db/overlays/workflow-controller-configmap.yaml create mode 100644 test/e2e/manifests/no-db.yaml create mode 100644 test/e2e/manifests/no-db/kustomization.yaml create mode 100644 test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml create mode 100644 test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index e723d16aabcf..dea3d54f4694 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,6 +137,14 @@ jobs: - store_artifacts: path: test-results destination: . + e2e-no-db: + working_directory: /home/circleci/.go_workspace/src/github.com/argoproj/argo + machine: + image: ubuntu-1604:201903-01 + environment: + DB: no-db + steps: + - e2e e2e-postgres: working_directory: /home/circleci/.go_workspace/src/github.com/argoproj/argo machine: diff --git a/Makefile b/Makefile index 147e24ef1a54..456f95e3f12e 100644 --- a/Makefile +++ b/Makefile @@ -208,6 +208,9 @@ manifests/install.yaml: dist/VERSION $(MANIFESTS) manifests/namespace-install.yaml: dist/VERSION $(MANIFESTS) env VERSION=$(VERSION) ./hack/update-manifests.sh +manifests/quick-start-no-db.yaml: dist/VERSION $(MANIFESTS) + env VERSION=$(VERSION) ./hack/update-manifests.sh + manifests/quick-start-mysql.yaml: dist/VERSION $(MANIFESTS) env VERSION=$(VERSION) ./hack/update-manifests.sh @@ -242,6 +245,24 @@ dist/postgres.yaml: test/e2e/manifests/postgres.yaml # Create Postgres e2e manifests cat test/e2e/manifests/postgres.yaml | sed 's/:latest/:$(IMAGE_TAG)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/postgres.yaml +test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml: test/e2e/manifests/postgres/overlays/argo-server-deployment.yaml +test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml: + cat test/e2e/manifests/postgres/overlays/argo-server-deployment.yaml | ./hack/auto-gen-msg.sh > test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml + +test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml: test/e2e/manifests/postgres/overlays/workflow-controller-deployment.yaml +test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml: + cat test/e2e/manifests/postgres/overlays/workflow-controller-deployment.yaml | ./hack/auto-gen-msg.sh > test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml + +test/e2e/manifests/no-db.yaml: $(MANIFESTS) $(E2E_MANIFESTS) test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml + # Create no DB e2e manifests + kustomize build test/e2e/manifests/no-db | ./hack/auto-gen-msg.sh > test/e2e/manifests/no-db.yaml + +dist/no-db.yaml: test/e2e/manifests/no-db.yaml + # Create no DB e2e manifests + # We additionlly disable ALWAY_OFFLOAD_NODE_STATUS + cat test/e2e/manifests/no-db.yaml | sed 's/:latest/:$(IMAGE_TAG)/' | sed 's/pns/$(E2E_EXECUTOR)/' | sed 's/"true"/"false"/' > dist/no-db.yaml + + test/e2e/manifests/mysql/overlays/argo-server-deployment.yaml: test/e2e/manifests/postgres/overlays/argo-server-deployment.yaml test/e2e/manifests/mysql/overlays/argo-server-deployment.yaml: cat test/e2e/manifests/postgres/overlays/argo-server-deployment.yaml | ./hack/auto-gen-msg.sh > test/e2e/manifests/mysql/overlays/argo-server-deployment.yaml @@ -259,13 +280,17 @@ dist/mysql.yaml: test/e2e/manifests/mysql.yaml cat test/e2e/manifests/mysql.yaml | sed 's/:latest/:$(IMAGE_TAG)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/mysql.yaml .PHONY: install -install: dist/postgres.yaml dist/mysql.yaml +install: dist/postgres.yaml dist/mysql.yaml dist/no-db.yaml # Install Postgres quick-start kubectl get ns argo || kubectl create ns argo ifeq ($(DB),postgres) kubectl -n argo apply -f dist/postgres.yaml else +ifeq ($(DB),mysql) kubectl -n argo apply -f dist/mysql.yaml +else + kubectl -n argo apply -f dist/no-db.yaml +endif endif .PHONY: test-images diff --git a/hack/update-manifests.sh b/hack/update-manifests.sh index d6abdc49617f..c494d98f9c1d 100755 --- a/hack/update-manifests.sh +++ b/hack/update-manifests.sh @@ -21,5 +21,6 @@ kustomize build "${SRCROOT}/manifests/namespace-install" | ${SRCROOT}/hack/auto- sed -i.bak "s@- .*/argoexec:.*@- ${IMAGE_NAMESPACE}/argoexec:${VERSION}@" "${SRCROOT}/manifests/namespace-install.yaml" rm -f "${SRCROOT}/manifests/namespace-install.yaml.bak" +kustomize build ${SRCROOT}/manifests/quick-start/no-db | sed "s/:latest/:$VERSION/" | ${SRCROOT}/hack/auto-gen-msg.sh > ${SRCROOT}/manifests/quick-start-no-db.yaml kustomize build ${SRCROOT}/manifests/quick-start/mysql | sed "s/:latest/:$VERSION/" | ${SRCROOT}/hack/auto-gen-msg.sh > ${SRCROOT}/manifests/quick-start-mysql.yaml kustomize build ${SRCROOT}/manifests/quick-start/postgres | sed "s/:latest/:$VERSION/" | ${SRCROOT}/hack/auto-gen-msg.sh > ${SRCROOT}/manifests/quick-start-postgres.yaml diff --git a/manifests/quick-start-no-db.yaml b/manifests/quick-start-no-db.yaml new file mode 100644 index 000000000000..ed7da9cbca8e --- /dev/null +++ b/manifests/quick-start-no-db.yaml @@ -0,0 +1,409 @@ +# This is an auto-generated file. DO NOT EDIT +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: cronworkflows.argoproj.io +spec: + group: argoproj.io + names: + kind: CronWorkflow + plural: cronworkflows + shortNames: + - cronwf + - cwf + scope: Namespaced + version: v1alpha1 +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: workflows.argoproj.io +spec: + additionalPrinterColumns: + - JSONPath: .status.phase + description: Status of the workflow + name: Status + type: string + - JSONPath: .status.startedAt + description: When the workflow was started + format: date-time + name: Age + type: date + group: argoproj.io + names: + kind: Workflow + plural: workflows + shortNames: + - wf + scope: Namespaced + version: v1alpha1 +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: workflowtemplates.argoproj.io +spec: + group: argoproj.io + names: + kind: WorkflowTemplate + plural: workflowtemplates + shortNames: + - wftmpl + scope: Namespaced + version: v1alpha1 +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: argo +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: argo-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: argo-role +rules: +- apiGroups: + - "" + resources: + - pods + - pods/exec + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - watch + - list +- apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - create + - delete +- apiGroups: + - argoproj.io + resources: + - workflows + - workflows/finalizers + verbs: + - get + - list + - watch + - update + - patch + - delete + - create +- apiGroups: + - argoproj.io + resources: + - workflowtemplates + - workflowtemplates/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - serviceaccounts + verbs: + - get + - list +- apiGroups: + - "" + resources: + - secrets + verbs: + - get +- apiGroups: + - argoproj.io + resources: + - cronworkflows + - cronworkflows/finalizers + verbs: + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: argo-server-role +rules: +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - watch + - list +- apiGroups: + - "" + resources: + - secrets + verbs: + - get +- apiGroups: + - "" + resources: + - pods + - pods/exec + - pods/log + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - get +- apiGroups: + - argoproj.io + resources: + - workflows + - workflowtemplates + - cronworkflows + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: workflow-role +rules: +- apiGroups: + - "" + resources: + - pods + verbs: + - get + - watch + - patch +- apiGroups: + - "" + resources: + - pods/log + verbs: + - get + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: argo-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argo-role +subjects: +- kind: ServiceAccount + name: argo +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: argo-server-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argo-server-role +subjects: +- kind: ServiceAccount + name: argo-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: workflow-default-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: workflow-role +subjects: +- kind: ServiceAccount + name: default +--- +apiVersion: v1 +data: + config: | + artifactRepository: + archiveLogs: true + s3: + bucket: my-bucket + endpoint: minio:9000 + insecure: true + accessKeySecret: + name: my-minio-cred + key: accesskey + secretKeySecret: + name: my-minio-cred + key: secretkey +kind: ConfigMap +metadata: + name: workflow-controller-configmap +--- +apiVersion: v1 +kind: Secret +metadata: + labels: + app: minio + name: my-minio-cred +stringData: + accesskey: admin + secretkey: password +type: Opaque +--- +apiVersion: v1 +kind: Service +metadata: + name: argo-server +spec: + ports: + - port: 2746 + targetPort: 2746 + selector: + app: argo-server +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: minio + name: minio +spec: + ports: + - port: 9000 + protocol: TCP + targetPort: 9000 + selector: + app: minio +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: argo-server +spec: + selector: + matchLabels: + app: argo-server + template: + metadata: + labels: + app: argo-server + spec: + containers: + - args: + - server + - --namespaced + image: argoproj/argocli:latest + name: argo-server + ports: + - containerPort: 2746 + readinessProbe: + httpGet: + path: / + port: 2746 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 30 + serviceAccountName: argo-server +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: workflow-controller +spec: + selector: + matchLabels: + app: workflow-controller + template: + metadata: + labels: + app: workflow-controller + spec: + containers: + - args: + - --configmap + - workflow-controller-configmap + - --executor-image + - argoproj/argoexec:latest + - --namespaced + command: + - workflow-controller + image: argoproj/workflow-controller:latest + name: workflow-controller + serviceAccountName: argo +--- +apiVersion: v1 +kind: Pod +metadata: + labels: + app: minio + name: minio +spec: + containers: + - command: + - minio + - server + - /data + env: + - name: MINIO_ACCESS_KEY + value: admin + - name: MINIO_SECRET_KEY + value: password + image: minio/minio:RELEASE.2019-12-17T23-16-33Z + lifecycle: + postStart: + exec: + command: + - mkdir + - -p + - /data/my-bucket + livenessProbe: + httpGet: + path: /minio/health/live + port: 9000 + initialDelaySeconds: 5 + periodSeconds: 10 + name: main + ports: + - containerPort: 9000 + readinessProbe: + httpGet: + path: /minio/health/ready + port: 9000 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/manifests/quick-start-none.yaml b/manifests/quick-start-none.yaml new file mode 100644 index 000000000000..d30f371b5b15 --- /dev/null +++ b/manifests/quick-start-none.yaml @@ -0,0 +1 @@ +# This is an auto-generated file. DO NOT EDIT diff --git a/manifests/quick-start/no-db/kustomization.yaml b/manifests/quick-start/no-db/kustomization.yaml new file mode 100644 index 000000000000..76f15e3feea7 --- /dev/null +++ b/manifests/quick-start/no-db/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +bases: + - ../base + +patchesStrategicMerge: + - overlays/workflow-controller-configmap.yaml \ No newline at end of file diff --git a/manifests/quick-start/no-db/overlays/workflow-controller-configmap.yaml b/manifests/quick-start/no-db/overlays/workflow-controller-configmap.yaml new file mode 100644 index 000000000000..e0cb4679606e --- /dev/null +++ b/manifests/quick-start/no-db/overlays/workflow-controller-configmap.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +data: + config: | + artifactRepository: + archiveLogs: true + s3: + bucket: my-bucket + endpoint: minio:9000 + insecure: true + accessKeySecret: + name: my-minio-cred + key: accesskey + secretKeySecret: + name: my-minio-cred + key: secretkey +kind: ConfigMap +metadata: + name: workflow-controller-configmap \ No newline at end of file diff --git a/test/e2e/argo_server_test.go b/test/e2e/argo_server_test.go index c9eeebb31600..5c7a89ef1783 100644 --- a/test/e2e/argo_server_test.go +++ b/test/e2e/argo_server_test.go @@ -369,9 +369,11 @@ func (s *ArgoServerSuite) TestWorkflowService() { Array(). Length(). Equal(1) - // check we are loading offloaded node status - j.Path("$.items[0].status.offloadNodeStatusVersion"). - NotNull() + if s.Persistence.IsEnabled() { + // check we are loading offloaded node status + j.Path("$.items[0].status.offloadNodeStatusVersion"). + NotNull() + } j.Path("$.items[0].status.nodes"). NotNull() }) @@ -381,10 +383,12 @@ func (s *ArgoServerSuite) TestWorkflowService() { Expect(). Status(200). JSON() - // check we are loading offloaded node status - j. - Path("$.status.offloadNodeStatusVersion"). - NotNull() + if s.Persistence.IsEnabled() { + // check we are loading offloaded node status + j. + Path("$.status.offloadNodeStatusVersion"). + NotNull() + } j.Path("$.status.nodes"). NotNull() s.e(t).GET("/api/v1/workflows/argo/not-found"). @@ -549,6 +553,9 @@ func (s *ArgoServerSuite) TestCronWorkflowService() { // make sure we can download an artifact func (s *ArgoServerSuite) TestArtifactServer() { + if !s.Persistence.IsEnabled() { + s.T().SkipNow() + } var uid types.UID s.Given(). Workflow("@smoke/basic.yaml"). @@ -668,6 +675,9 @@ func (s *ArgoServerSuite) TestWorkflowServiceStream() { } func (s *ArgoServerSuite) TestArchivedWorkflowService() { + if !s.Persistence.IsEnabled() { + s.T().SkipNow() + } var uid types.UID s.Given(). Workflow("@smoke/basic.yaml"). diff --git a/test/e2e/cli_test.go b/test/e2e/cli_test.go index 2e0490db37ce..e9185755ec5f 100644 --- a/test/e2e/cli_test.go +++ b/test/e2e/cli_test.go @@ -145,6 +145,9 @@ func (s *CLISuite) TestCron() { } func (s *CLISuite) TestArchive() { + if !s.Persistence.IsEnabled() { + s.T().SkipNow() + } var uid types.UID s.Given(). Workflow("@smoke/basic.yaml"). diff --git a/test/e2e/fixtures/persistence.go b/test/e2e/fixtures/persistence.go index 0115870a197e..e14c3dc7d4bb 100644 --- a/test/e2e/fixtures/persistence.go +++ b/test/e2e/fixtures/persistence.go @@ -25,38 +25,47 @@ func newPersistence(kubeClient kubernetes.Interface) *Persistence { if err != nil { panic(err) } - if wcConfig == nil { - return nil - } persistence := wcConfig.Persistence - if persistence.PostgreSQL != nil { - persistence.PostgreSQL.Host = "localhost" - } - if persistence.MySQL != nil { - persistence.MySQL.Host = "localhost" + if persistence != nil { + if persistence.PostgreSQL != nil { + persistence.PostgreSQL.Host = "localhost" + } + if persistence.MySQL != nil { + persistence.MySQL.Host = "localhost" + } + session, tableName, err := sqldb.CreateDBSession(kubeClient, Namespace, persistence) + if err != nil { + panic(err) + } + offloadNodeStatusRepo := sqldb.NewOffloadNodeStatusRepo(session, persistence.GetClusterName(), tableName) + return &Persistence{session, offloadNodeStatusRepo} + } else { + return &Persistence{offloadNodeStatusRepo: sqldb.ExplosiveOffloadNodeStatusRepo} } - session, tableName, err := sqldb.CreateDBSession(kubeClient, Namespace, persistence) - if err != nil { - panic(err) - } - offloadNodeStatusRepo := sqldb.NewOffloadNodeStatusRepo(session, persistence.GetClusterName(), tableName) - return &Persistence{session, offloadNodeStatusRepo} +} + +func (s *Persistence) IsEnabled() bool { + return s.offloadNodeStatusRepo.IsEnabled() } func (s *Persistence) Close() { - err := s.session.Close() - if err != nil { - panic(err) + if s.IsEnabled() { + err := s.session.Close() + if err != nil { + panic(err) + } } } func (s *Persistence) DeleteEverything() { - _, err := s.session.DeleteFrom("argo_workflows").Exec() - if err != nil { - panic(err) - } - _, err = s.session.DeleteFrom("argo_archived_workflows").Exec() - if err != nil { - panic(err) + if s.IsEnabled() { + _, err := s.session.DeleteFrom("argo_workflows").Exec() + if err != nil { + panic(err) + } + _, err = s.session.DeleteFrom("argo_archived_workflows").Exec() + if err != nil { + panic(err) + } } } diff --git a/test/e2e/manifests/no-db.yaml b/test/e2e/manifests/no-db.yaml new file mode 100644 index 000000000000..a4d42ac86b20 --- /dev/null +++ b/test/e2e/manifests/no-db.yaml @@ -0,0 +1,433 @@ +# This is an auto-generated file. DO NOT EDIT +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: cronworkflows.argoproj.io +spec: + group: argoproj.io + names: + kind: CronWorkflow + plural: cronworkflows + shortNames: + - cronwf + - cwf + scope: Namespaced + version: v1alpha1 +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: workflows.argoproj.io +spec: + additionalPrinterColumns: + - JSONPath: .status.phase + description: Status of the workflow + name: Status + type: string + - JSONPath: .status.startedAt + description: When the workflow was started + format: date-time + name: Age + type: date + group: argoproj.io + names: + kind: Workflow + plural: workflows + shortNames: + - wf + scope: Namespaced + version: v1alpha1 +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: workflowtemplates.argoproj.io +spec: + group: argoproj.io + names: + kind: WorkflowTemplate + plural: workflowtemplates + shortNames: + - wftmpl + scope: Namespaced + version: v1alpha1 +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: argo +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: argo-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: argo-role +rules: +- apiGroups: + - "" + resources: + - pods + - pods/exec + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - watch + - list +- apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - create + - delete +- apiGroups: + - argoproj.io + resources: + - workflows + - workflows/finalizers + verbs: + - get + - list + - watch + - update + - patch + - delete + - create +- apiGroups: + - argoproj.io + resources: + - workflowtemplates + - workflowtemplates/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - serviceaccounts + verbs: + - get + - list +- apiGroups: + - "" + resources: + - secrets + verbs: + - get +- apiGroups: + - argoproj.io + resources: + - cronworkflows + - cronworkflows/finalizers + verbs: + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: argo-server-role +rules: +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - watch + - list +- apiGroups: + - "" + resources: + - secrets + verbs: + - get +- apiGroups: + - "" + resources: + - pods + - pods/exec + - pods/log + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - get +- apiGroups: + - argoproj.io + resources: + - workflows + - workflowtemplates + - cronworkflows + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: workflow-role +rules: +- apiGroups: + - "" + resources: + - pods + verbs: + - get + - watch + - patch +- apiGroups: + - "" + resources: + - pods/log + verbs: + - get + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: argo-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argo-role +subjects: +- kind: ServiceAccount + name: argo +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: argo-server-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argo-server-role +subjects: +- kind: ServiceAccount + name: argo-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: workflow-default-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: workflow-role +subjects: +- kind: ServiceAccount + name: default +--- +apiVersion: v1 +data: + config: | + artifactRepository: + archiveLogs: true + s3: + bucket: my-bucket + endpoint: minio:9000 + insecure: true + accessKeySecret: + name: my-minio-cred + key: accesskey + secretKeySecret: + name: my-minio-cred + key: secretkey +kind: ConfigMap +metadata: + name: workflow-controller-configmap +--- +apiVersion: v1 +kind: Secret +metadata: + labels: + app: minio + name: my-minio-cred +stringData: + accesskey: admin + secretkey: password +type: Opaque +--- +apiVersion: v1 +kind: Service +metadata: + name: argo-server +spec: + ports: + - port: 2746 + targetPort: 2746 + selector: + app: argo-server +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: minio + name: minio +spec: + ports: + - port: 9000 + protocol: TCP + targetPort: 9000 + selector: + app: minio +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: argo-server +spec: + selector: + matchLabels: + app: argo-server + template: + metadata: + labels: + app: argo-server + spec: + containers: + - args: + - server + - --namespaced + - --auth-mode + - client + - --loglevel + - debug + env: + - name: ARGO_TOKEN + value: password + - name: UPPERIO_DB_DEBUG + value: "1" + image: argoproj/argocli:latest + imagePullPolicy: Never + name: argo-server + ports: + - containerPort: 2746 + readinessProbe: + httpGet: + path: / + port: 2746 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 30 + serviceAccountName: argo-server +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: workflow-controller +spec: + selector: + matchLabels: + app: workflow-controller + template: + metadata: + labels: + app: workflow-controller + spec: + containers: + - args: + - --configmap + - workflow-controller-configmap + - --executor-image + - argoproj/argoexec:latest + - --namespaced + - --loglevel + - debug + - --executor-image-pull-policy + - Never + - --container-runtime-executor + - pns + command: + - workflow-controller + env: + - name: ALWAYS_OFFLOAD_NODE_STATUS + value: "true" + - name: WORKFLOW_GC_PERIOD + value: 30s + - name: UPPERIO_DB_DEBUG + value: "1" + image: argoproj/workflow-controller:latest + imagePullPolicy: Never + name: workflow-controller + serviceAccountName: argo +--- +apiVersion: v1 +kind: Pod +metadata: + labels: + app: minio + name: minio +spec: + containers: + - command: + - minio + - server + - /data + env: + - name: MINIO_ACCESS_KEY + value: admin + - name: MINIO_SECRET_KEY + value: password + image: minio/minio:RELEASE.2019-12-17T23-16-33Z + lifecycle: + postStart: + exec: + command: + - mkdir + - -p + - /data/my-bucket + livenessProbe: + httpGet: + path: /minio/health/live + port: 9000 + initialDelaySeconds: 5 + periodSeconds: 10 + name: main + ports: + - containerPort: 9000 + readinessProbe: + httpGet: + path: /minio/health/ready + port: 9000 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/test/e2e/manifests/no-db/kustomization.yaml b/test/e2e/manifests/no-db/kustomization.yaml new file mode 100644 index 000000000000..440827648be7 --- /dev/null +++ b/test/e2e/manifests/no-db/kustomization.yaml @@ -0,0 +1,19 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +bases: + - ../../../../manifests/quick-start/no-db + +patchesJson6902: + - target: + version: v1 + group: apps + kind: Deployment + name: workflow-controller + path: overlays/workflow-controller-deployment.yaml + - target: + version: v1 + group: apps + kind: Deployment + name: argo-server + path: overlays/argo-server-deployment.yaml diff --git a/test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml b/test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml new file mode 100644 index 000000000000..26413d7ecd37 --- /dev/null +++ b/test/e2e/manifests/no-db/overlays/argo-server-deployment.yaml @@ -0,0 +1,23 @@ +# This is an auto-generated file. DO NOT EDIT +- op: replace + path: /spec/template/spec/containers/0/imagePullPolicy + value: Never +- op: add + path: /spec/template/spec/containers/0/args/- + value: --auth-mode +- op: add + path: /spec/template/spec/containers/0/args/- + value: client +- op: add + path: /spec/template/spec/containers/0/args/- + value: --loglevel +- op: add + path: /spec/template/spec/containers/0/args/- + value: debug +- op: add + path: /spec/template/spec/containers/0/env + value: + - name: ARGO_TOKEN + value: password + - name: UPPERIO_DB_DEBUG + value: "1" diff --git a/test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml b/test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml new file mode 100644 index 000000000000..2192bd96dbfa --- /dev/null +++ b/test/e2e/manifests/no-db/overlays/workflow-controller-deployment.yaml @@ -0,0 +1,31 @@ +# This is an auto-generated file. DO NOT EDIT +- op: replace + path: /spec/template/spec/containers/0/imagePullPolicy + value: Never +- op: add + path: /spec/template/spec/containers/0/args/- + value: --loglevel +- op: add + path: /spec/template/spec/containers/0/args/- + value: debug +- op: add + path: /spec/template/spec/containers/0/args/- + value: --executor-image-pull-policy +- op: add + path: /spec/template/spec/containers/0/args/- + value: Never +- op: add + path: /spec/template/spec/containers/0/args/- + value: --container-runtime-executor +- op: add + path: /spec/template/spec/containers/0/args/- + value: pns +- op: add + path: /spec/template/spec/containers/0/env + value: + - name: ALWAYS_OFFLOAD_NODE_STATUS + value: "true" + - name: WORKFLOW_GC_PERIOD + value: 30s + - name: UPPERIO_DB_DEBUG + value: "1" diff --git a/workflow/controller/config_controller.go b/workflow/controller/config_controller.go index 5c547b7427dc..987a0d2bbdee 100644 --- a/workflow/controller/config_controller.go +++ b/workflow/controller/config_controller.go @@ -55,7 +55,7 @@ func (wfc *WorkflowController) updateConfig(cm *apiv1.ConfigMap) error { } } wfc.session = nil - wfc.offloadNodeStatusRepo = nil + wfc.offloadNodeStatusRepo = sqldb.ExplosiveOffloadNodeStatusRepo wfc.wfArchive = sqldb.NullWorkflowArchive persistence := wfc.Config.Persistence if persistence != nil { From 351f1a14d8ec6be10ee68c3a7f872ced1c5f5287 Mon Sep 17 00:00:00 2001 From: Alex Collins <alex_collins@intuit.com> Date: Fri, 24 Jan 2020 09:27:19 -0800 Subject: [PATCH 2/3] removed file --- manifests/quick-start-none.yaml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 manifests/quick-start-none.yaml diff --git a/manifests/quick-start-none.yaml b/manifests/quick-start-none.yaml deleted file mode 100644 index d30f371b5b15..000000000000 --- a/manifests/quick-start-none.yaml +++ /dev/null @@ -1 +0,0 @@ -# This is an auto-generated file. DO NOT EDIT From ca4b0958834c0b9e4d0229049180c87a79c19dc7 Mon Sep 17 00:00:00 2001 From: Alex Collins <alex_collins@intuit.com> Date: Fri, 24 Jan 2020 09:43:00 -0800 Subject: [PATCH 3/3] ci: run no-db --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index dea3d54f4694..769d7d9ea765 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -200,6 +200,7 @@ workflows: jobs: - test - ui + - e2e-no-db - e2e-postgres - e2e-mysql - docker-build \ No newline at end of file