Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 397 forks source link

Pre-up tasks happen after environment/helm chart is loaded #805

Closed sam-doordash closed 6 years ago

sam-doordash commented 6 years ago

Currently, the pre-up draft tasks happen after the environment and helm chart have been loaded in to memory, so it's not possible to download helm dependencies using helm dependency update a pre-up task and have them loaded with the rest of the chart and deployed.

.draft-tasks.toml

[pre-up]
"pre-up starting" = "echo pre-up starting"
"helm requirements download" = "helm dependency update charts/dd-draft-base"

[post-deploy]
"deploy finished" = "echo deploy finished"

[post-delete]
"delete finished" = "echo delete finished"

Error

ip-192-168-1-10:draft-test sanders$ draft up
pre-up starting
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
    Get http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "doordash" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading helm-base-chart from repo https://ddartifacts.jfrog.io/ddartifacts/helm
Deleting outdated charts
Draft Up Started: 'draft-test': 01CEYGKE13FQA754GPFQ56FSN5
draft-test: Building Docker Image: SUCCESS ⚓  (1.0003s)
draft-test: Pushing Docker Image: SUCCESS ⚓  (1.5880s)
draft-test: Releasing Application: FAIL ❌  (0.6861s)
Inspect the logs with `draft logs 01CEYGKE13FQA754GPFQ56FSN5`
ip-192-168-1-10:draft-test sanders$ draft up
pre-up starting
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
    Get http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "doordash" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading helm-base-chart from repo https://ddartifacts.jfrog.io/ddartifacts/helm
Deleting outdated charts
Draft Up Started: 'draft-test': 01CEYGKQSEACGGGSA275K96CER
draft-test: Building Docker Image: SUCCESS ⚓  (1.0007s)
draft-test: Pushing Docker Image: SUCCESS ⚓  (1.2586s)
draft-test: Releasing Application: SUCCESS ⚓  (3.9214s)
Inspect the logs with `draft logs 01CEYGKQSEACGGGSA275K96CER`
ip-192-168-1-10:draft-test sanders$ 
jgleonard commented 6 years ago

@sam-doordash do you have a sample repo to use?

sam-doordash commented 6 years ago

Let me put one together. I do have one, but it's all internal currently.

jgleonard commented 6 years ago

Thanks Sam, I reordered it locally but want to validate before suggesting a PR. On Mon, Jun 4, 2018 at 4:03 PM sam-doordash notifications@github.com wrote:

Let me put one together. I do have one, but it's all internal currently.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Azure/draft/issues/805#issuecomment-394480691, or mute the thread https://github.com/notifications/unsubscribe-auth/AZZSDVMv_HtVyvbsa_DVsfwxb4D-pOF4ks5t5ZKYgaJpZM4UXRcK .

sam-doordash commented 6 years ago

https://github.com/sam-doordash/draft_helm_dependencies_demo Here's a simple demo service. I'm not sure if the app itself works, but I'm more worried about the app being deployed to kubernetes successfully.

@jgleonard

jgleonard commented 6 years ago

@sam-doordash Looks ok to me...

✔ ~/go/src/github.com/Azure/draft/draft_helm_dependencies_demo [master|✚ 1] (⎈ |minikube:default)
22:36 $ ../bin/draft up
pre-up starting
Error: no repository definition for @incubator. Please add them via 'helm repo add'
Draft Up Started: 'draft-helm-dependencies-demo': 01CF9F8NRQ64PEA7QHX5CXMSHA
draft-helm-dependencies-demo: Building Docker Image: SUCCESS ⚓  (39.1191s)
draft-helm-dependencies-demo: Releasing Application: SUCCESS ⚓  (2.2482s)
Inspect the logs with `draft logs 01CF9F8NRQ64PEA7QHX5CXMSHA`

The only change I made locally for your repo was to specify the dockerfile name in draft.toml.

bacongobbler commented 6 years ago

addressed in #813