{"id":19329730,"url":"https://github.com/outerbounds/github-actions-on-obp-demo","last_synced_at":"2025-02-24T06:43:39.098Z","repository":{"id":184554446,"uuid":"672019684","full_name":"outerbounds/github-actions-on-obp-demo","owner":"outerbounds","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-17T18:04:39.000Z","size":961,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-06T08:17:42.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outerbounds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-28T17:48:38.000Z","updated_at":"2024-10-24T16:08:49.000Z","dependencies_parsed_at":"2024-11-10T02:29:48.747Z","dependency_job_id":"6532b54c-9cd6-47d0-847f-430f6da01164","html_url":"https://github.com/outerbounds/github-actions-on-obp-demo","commit_stats":null,"previous_names":["outerbounds/github-actions-on-obp-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fgithub-actions-on-obp-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fgithub-actions-on-obp-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fgithub-actions-on-obp-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outerbounds%2Fgithub-actions-on-obp-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outerbounds","download_url":"https://codeload.github.com/outerbounds/github-actions-on-obp-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240434233,"owners_count":19800548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T02:29:43.280Z","updated_at":"2025-02-24T06:43:39.025Z","avatar_url":"https://github.com/outerbounds.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Actions on Outerbounds Platform Demo\nA basic repo structure to run CI/CD jobs on Outerbounds platform. \n\n### Create a machine user in Outerbounds UI\n- In the Outerbounds UI, go to the `Admin` panel on the left side navigation and select `Users`. \n- Under `Machines` click the `Create New` button.\n- Fill out the form, choosing the desired GitHub Actions form, and filling in the desired GitHub organization and repository. \n- After submitting, click the row for the Machine User you created, and a code snippet will appear.\n- Paste the command in actions file in `.github/workflows/` and modify it to run Metaflow code in the repository.\n\n### Write flows and run them on desired GitHub Actions\nOur goal is to update the model used in the `Predict` workflow defined in `prediction_flow.py`. As a starting point for the CI/CD lifecycle, consider how a data scientist iterates. This repository demonstrates how to take the result of experimental, interactive development and use it to: \n- create a GitHub branch, \n- let an automatic CI/CD process built with GitHub Actions validate the model's quality (using Outerbounds platform resources), and\n- if the new model code meets certain user-defined criteria, automatically deploy the newly trained model to be used in the production workflow that makes predictions accessed by other production applications.\n\n\n### Deploy the `Predict` workflow to production\nA data scientist or ML engineer would do this rarely, and typically less frequently than the model selection/architecture in `my_data_science_module.py` updates.\nThis only needs to be done if the code in `predict_flow.py` file updates.\n```\npython predict_flow.py --production argo-workflows create\n```\n\n#### Manually trigger the production workflow\nThis is a way to manually trigger a refresh of the production run that populates the model prediction cache accessed by other production applications.\n```\npython predict_flow.py --production argo-workflows trigger\n```\n\n### Local iteration on `EvaluateNewModel`\nLocal/workstation testing:\n```\npython evaluate_new_model_flow.py run\n```\n\n### CI/CD process using GitHub Actions\nWhen a data scientist is satisfied with what they see on local runs, then they can use GitHub commands like a regular software development workflow:\n```\ngit switch -c 'my-new-model-branch'\ngit add .\ngit commit -m 'A model I think is ready for production'\ngit push --set-upstream origin my-new-model-branch\n```\n\nAfter the model is pushed to the remote branch of `my-new-model-branch`, the data scientist or an engineering colleague can open a pull request against the main branch. When this pull request gets merged to the `main` branch of the repository, a GitHub action defined in `.github/workflows/assess_new_production_model.yml` is triggered. To explore the many complex patterns like this you can implement with GitHub actions, consider step 5 of the [Create and Configure your IAM Role](https://docs.google.com/document/d/1If-Nh4EY4cs5wDihWhnDglE-NKqu8Gv0-ZwXcw4cons/edit) section, and the many types of [events you can use to trigger a GitHub Action](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).\n\nThe GitHub Action in this template will do the following:\n1. Run the `EvaluateNewModel` workflow defined in `evaluate_new_model_flow.py`.\n2. If the `EvaluateNewModel` workflow produces a model that meets some user-defined criteria (e.g., beyond some performance metric threshold), then tag the Metaflow run in which the model was trained as a `deployment_candidate`.\n3. If the upstream `EvaluateNewModel` run is tagged as a `deployment_candidate` and the model meets any other criteria you add to this template, then the production workflow will use a new version of the model in the `predict.py` flow in an ongoing fashion.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fouterbounds%2Fgithub-actions-on-obp-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fouterbounds%2Fgithub-actions-on-obp-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fouterbounds%2Fgithub-actions-on-obp-demo/lists"}