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

Expose override in qhub-config.yaml for prefect #799

Closed
1 task done
costrouc opened this issue Sep 2, 2021 · 5 comments
Closed
1 task done

Expose override in qhub-config.yaml for prefect #799

costrouc opened this issue Sep 2, 2021 · 5 comments
Assignees
Labels
type: enhancement 💅🏼 New feature or request

Comments

@costrouc
Copy link
Member

costrouc commented Sep 2, 2021

Description

Currently the prefect chart provided in QHub is too restrictive. Would like to provide the option for more flexible Prefect deployments while making the helm chart follow prefect more closely.

Acceptance Criteria

  • add an overrides variable to prefect chart that follows the model in jupyterhub
  • add an overrides key to the qhub-config.yaml in prefect that allows user based overrides
prefect:
   enabled: true
   ...
   overrides:
       ...
@viniciusdc
Copy link
Contributor

Tested it and got the following resuts:

# module.prefect.helm_release.prefect will be created
# module.prefect.helm_release.prefect will be created
   + resource "helm_release" "prefect" {
       + atomic                     = false
       + chart                      = "modules/kubernetes/services/prefect/chart"
       + cleanup_on_fail            = false
       + create_namespace           = false
       + dependency_update          = false
       + disable_crd_hooks          = false
       + disable_openapi_validation = false
       + disable_webhooks           = false
       + force_update               = false
       + id                         = (known after apply)
       + lint                       = false
       + manifest                   = (known after apply)
       + max_history                = 0
       + metadata                   = (known after apply)
       + name                       = "prefect"
       + namespace                  = "dev"
       + recreate_pods              = false
       + render_subchart_notes      = true
       + replace                    = false
       + reset_values               = false
       + reuse_values               = false
       + skip_crds                  = false
       + status                     = "deployed"
       + timeout                    = 300
       + values                     = [
           + <<-EOT
                 spec:
                   template:
                     spec:
                       containers:
                         - env:
                             - name: IMAGE_PULL_SECRETS
                               value: ''
                             - name: PREFECT__CLOUD__AGENT__LABELS
                               value: '[]'
                             - name: JOB_MEM_REQUEST
                               value: ''
                             - name: JOB_MEM_LIMIT
                               value: ''
                             - name: JOB_CPU_REQUEST
                               value: ''
                             - name: JOB_CPU_LIMIT
                               value: ''
                             - name: IMAGE_PULL_POLICY
                               value: ''
                             - name: PREFECT__BACKEND
                               value: cloud
                             - name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
                               value: http://:8080
             EOT,
           + "[{'PREFECT__CLOUD__AGENT__LABELS': ['dev', 'prod'], 'JOB_MEM_REQUEST': '20Gi'}]",
         ]
       + verify                     = false
       + version                    = "0.1.0"
       + wait                       = true
       + wait_for_jobs              = false
 
       + set {
           + name  = "cloudApi"
           + value = "https://api.prefect.io"
         }
       + set {
           + name  = "namespace"
           + value = "dev"
         }
       + set {
           + name  = "prefectImage"
           + value = "prefecthq/prefect:0.14.22-python3.8"
         }
 
       + set_sensitive {
           # At least one attribute in this block is (or was) sensitive,
           # so its contents will not be displayed.
         }
     }

Tying to solve the folowing error:

Error: ---> error unmarshaling JSON: while decoding JSON: json: cannot unmarshal array into Go value of type map[string]interface {} [{'PREFECT__CLOUD__AGENT__LABELS': ['dev', 'prod'], 'JOB_MEM_REQUEST': '20Gi'}]
 │ 
 │   with module.prefect.helm_release.prefect,
 │   on modules/kubernetes/services/prefect/main.tf line 1, in resource "helm_release" "prefect":
 │    1: resource "helm_release" "prefect" {
 │ 

@viniciusdc
Copy link
Contributor

Error solved and deplymen was suecessuf, simple test on qhub-config:

prefect:
  enabled: true
  overrides:
      prefect_agent:
        prefectLabels: [dev, prod]
        job:
          resources:
            requests:
              memory: 20Gi

Output on Prefec-agent service (by K9s):

Environment:                                                                                                                                                                                                                                                                                                                                                                                       
│       PREFECT__CLOUD__AGENT__LABELS:         ["dev","prod"]                                                                                                                                                                       │
│       JOB_MEM_REQUEST:                       20Gi                                                                                                                                                                                 

@viniciusdc
Copy link
Contributor

#813

@github-actions
Copy link

This issue has been automatically marked as stale because there was no recent activity in 60 days. Remove the stale label or add a comment, otherwise, this issue will automatically be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the status: stale 🥖 Not up to date with the default branch - needs update label Nov 15, 2021
@viniciusdc viniciusdc removed the status: stale 🥖 Not up to date with the default branch - needs update label Nov 16, 2021
@viniciusdc viniciusdc changed the title Remove local helm chart, provide overrides, and expose override in qhub-config.yaml for prefect Expose override in qhub-config.yaml for prefect Nov 16, 2021
@viniciusdc
Copy link
Contributor

Closed by #813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement 💅🏼 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants