-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix Monorepo Setup & Separate by Role #133
Conversation
...ate/{{.input_root_dir}}/.azure/devops-pipelines/{{.input_project_name}}-bundle-cicd.yml.tmpl
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach of copying the CICD files of the first project will not work well because it assumes that all the projects have the same CICD platform and feature store selections, which may not be the case.
...ate/{{.input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/README.md.tmpl
Show resolved
Hide resolved
9655d71
to
777540e
Compare
description: | | ||
MLflow registered model for the "{{template `project_name` .}}" ML Project. See the corresponding [Git repo]($#{var.git_repo_url}) for details on the project. | ||
|
||
Links: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing these links since var.git_repo_url
has been broken for a while, and linking to these jobs does not merit providing databricks_prod_workspace_host
as a variable.
...input_root_dir}}/{{template `project_name_alphanumeric_underscore` .}}/requirements.txt.tmpl
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a first pass and didn't see any major issue. This is indeed a complex PR.
template/{{.input_root_dir}}/.github/workflows/{{.input_root_dir}}-deploy-cicd.yml.tmpl
Outdated
Show resolved
Hide resolved
template/{{.input_root_dir}}/.github/workflows/{{.input_root_dir}}-deploy-cicd.yml.tmpl
Outdated
Show resolved
Hide resolved
...ate/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-bundle-cd-staging.yml.tmpl
Outdated
Show resolved
Hide resolved
template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-run-tests-fs.yml.tmpl
Show resolved
Hide resolved
template/{{.input_root_dir}}/.azure/devops-pipelines/{{.input_root_dir}}-deploy-cicd.yml.tmpl
Outdated
Show resolved
Hide resolved
template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}-run-tests.yml.tmpl
Show resolved
Hide resolved
The preview comments has been addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really a huge improvement of the CUJs.
couple of minor things that need to be fixed in order to get the deploy cicd pipeline running for Azure DevOps. Aside from those, looks good. Thanks for this @arpitjasa-db , appreciate this was a tricky one to work through! Set up a mono repo to test here https://dev.azure.com/niallturbitt/_git/monorepo-mlops-stacks - have added you as an admin Arpit |
just catching this. For the second project I generated there were no staging or prod profiles defined in the What this means though, is that when the CI/CD pipelines are triggered for the second project, there is not staging/prod profiles defined for the bundles CI/CD pipeline to use We either need to somehow automate the addition of staging/test profiles to the databricks.yaml file of the new project whenever we are running the deploy cicd pipeline for the new project. Or direct the user to do so somewhere in documentation |
@niall-turbitt I actually added the profile generation as part of the deploy CICD pipeline. Did it not work? |
Ah actually I see we forgot to include that file when we did |
git add .azure | ||
git commit -m "Add CICD for {{`${{ parameters.ProjectName }}`}}" | ||
git push origin add-cicd-for-{{`${{ parameters.ProjectName }}`}} | ||
displayName: Push CICD Bundle to a New Branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is going to be annoying with Azure DevOps...
In order to run the Push CICD Bundle to a New Branch
step, we will need to enable the project Build Service to be able to contribute and create a branch for the project. i.e when the deploy CI/CD pipeline is triggered, the build service that runs this pipeline needs the necessary permissions to be able to push
To do this, you need to do the following: go to Project Settings -> Repositories -> Security -> Select <project_name> Build Service under users and set “Contribute”, “Create Branch”, and "Contribute to pull requests" to “Allow”
@arpitjasa-db this will only be applicable to the Monorepo case where you have an instantiate project, have added a second project and then want to set up CI/CD for this second project. I would suggest we add this to the Configure CI/CD - Azure DevOps docs in mlops-setup.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also hitting issues on this with the push.
Resolved this with : git push --force origin add-cicd-for-${{ parameters.ProjectName }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit concerned about adding --force
on the off-chance someone has the same branch or has force pushes disabled on their repository. Seems a bit weird to need to do add this flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added --force-with-lease
to prevent the overwriting possibility, and someone can just update the pipeline to remove this if they have force disabled on the whole repo/org
template/{{.input_root_dir}}/.azure/devops-pipelines/deploy-cicd.yml.tmpl
Outdated
Show resolved
Hide resolved
@arpitjasa-db the above comments I had added but didn't properly publish, so don't think you caught them. I see the The only other thing I think needs addressing is this point around documenting the permissions for the build service to be able to run the deploy CICD pipeline successfully |
one other minor nit that I think could be confusing for users is the following in a monorepo setup:
From the default |
@niall-turbitt good catch! Added a step in GH and ADO to create a underscore version of the project name and use that for the directory instead so they can continue using the normal name |
Changes
This PR makes multiple changes in line with the Separate by Role Project Proposal to separate CICD generation from project generation to allow monorepos to work and making the division more intuitive:
input_setup_cicd_and_project
that will allow three parameters:CICD_and_Project
(the current default flow),Project_Only
which sets up only project files, andCICD_Only
which only sets up the root directory and provides a workflow to generate CI/CD files for each project in the directory.Fixes #122
Also includes various quality-of-life improvements and minor bug fixes such as constant config versions, clean-up of unused variables, and proper file generation.
Tests
Project Generation Workflow:
CICD Zip Generation Workflow