-
Notifications
You must be signed in to change notification settings - Fork 2
pipeline health POC #59
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
Open
edmundmiller
wants to merge
45
commits into
main
Choose a base branch
from
pipeline_health
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
d10fd30
docs: Get the project started
edmundmiller d4dc7d4
chore: Copy over code from teams
edmundmiller 2efa2be
chore: re-encrypt GitHub token
edmundmiller 2c2deb6
chore: pulumi import github:index/repository:Repository nf-core-tf mo…
edmundmiller 66c4ef4
docs: Write up some plans
edmundmiller 7d7df5d
Add missing repos
edmundmiller 4734c3f
chore: Sort lines
edmundmiller 9654778
chore: Add pipelines
edmundmiller 83bd8ff
chore: Add two different ways of tackling this
edmundmiller b07ebfb
Add demo and testpipeline
edmundmiller e3f8b97
Add Old Pipeline Health PHP code
edmundmiller 00c6912
Add docs on using 1password to automatically switch contexts
edmundmiller 5992eee
feat: Add prod esc environment
edmundmiller b4bfda2
chore: Remove template
edmundmiller f733779
chore: Import nf-core/testpipeline
edmundmiller 0998598
refactor: Move testpipeline into it's own file
edmundmiller 434717b
Take a stab at some settings
edmundmiller 2a64c46
Add Specs from php code
edmundmiller 6f46da7
chore: Import default branch
edmundmiller b02bbc5
chore: Import testpipeline template branch
edmundmiller 2ae8da8
chore: Import testpipeline dev branch
edmundmiller d318b67
chore: Check off some TODOs
edmundmiller e96a9ce
chore: Import Master Branch protection
edmundmiller df10916
chore: Import dev branch ruleset
edmundmiller 442d925
chore: Import template branch ruleset for testpipeline
edmundmiller 5bf2407
chore: Remove duplicate TODO
edmundmiller 68eedf4
chore: Match up specs with code
edmundmiller 6104a30
feat: Update dev branch requirements
edmundmiller 5e15568
refactor: Move required CI Checks out
edmundmiller 0adf214
feat: Add contributors and core permissions
edmundmiller 0a5c862
refactor: Use NAME variable where ever possible
edmundmiller 62c608d
Remove protect on repo
edmundmiller 3df19aa
ci: Add template workflow for repos
edmundmiller 4067d72
ci: Remove python-version
edmundmiller 46b5d68
style: Run pre-commit
edmundmiller ec7a222
Apply suggestions from code review
edmundmiller c6df079
chore: Add 1password link
edmundmiller 7dc11d7
docs: Clean up README moving planning to GH issue
edmundmiller 1096f8c
refactor: Use Pulumi ESC for dev
edmundmiller be3d2f2
docs: Add some nf-core Pulumi starter info
edmundmiller 1db1ddb
build: Use uv
edmundmiller ea0511d
chore: Update pulumi-github dependency to version 6.7.2 and remove ruff
edmundmiller df4352c
fix: Address PR Review comments
edmundmiller 13e7a61
build: Integrate 1Password provider for GitHub token management
edmundmiller 8ec8496
style: Run pre-commit
edmundmiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Preview or update Pulumi app nf-core/github-repos/prod | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "pulumi/github/repos/**/*" | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "pulumi/github/repos/**/*" | ||
|
||
# These are the environment variables that jobs in the workflow have access to. | ||
# By defining them here, all jobs/steps will have access to these variables. | ||
env: | ||
# IMPORTANT! You must map the env vars for your cloud provider here even though you add them as secrets | ||
# to this repository. | ||
# See the setup page for cloud providers here: https://www.pulumi.com/docs/intro/cloud-providers/. | ||
# For example, if you are using AWS, then you should add the following: | ||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
PULUMI_STACK_NAME: nf-core/github-repos/prod | ||
PULUMI_WORKING_DIRECTORY: pulumi/github/repos/ | ||
|
||
jobs: | ||
pulumi: | ||
name: Pulumi | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Turnstyle is used to prevent multiple push jobs from running at the same time. We | ||
# limit it to push jobs to allow PR jobs to run concurrently. | ||
- name: Turnstyle | ||
if: ${{ github.event_name == 'push' }} | ||
uses: softprops/turnstyle@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
edmundmiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cache: "pip" | ||
|
||
- run: pip install -r requirements.txt | ||
working-directory: ${{ env.PULUMI_WORKING_DIRECTORY }} | ||
|
||
- name: PR previews | ||
uses: pulumi/actions@v6 | ||
with: | ||
command: preview | ||
stack-name: ${{ env.PULUMI_STACK_NAME }} | ||
work-dir: ${{ env.PULUMI_WORKING_DIRECTORY }} | ||
|
||
- name: Apply infrastructure update | ||
if: ${{ github.event_name == 'push' }} | ||
uses: pulumi/actions@v6 | ||
with: | ||
command: up | ||
stack-name: ${{ env.PULUMI_STACK_NAME }} | ||
work-dir: ${{ env.PULUMI_WORKING_DIRECTORY }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Pulumi | ||
|
||
[Pulumi Shell Plugin](https://developer.1password.com/docs/cli/shell-plugins/pulumi/) | ||
|
||
[How to use 1Password with different accounts automatically](https://developer.1password.com/docs/cli/shell-plugins/multiple-accounts/) | ||
|
||
```console | ||
cd ~/src/nf-core | ||
|
||
op signin | ||
|
||
# Select nf-core | ||
edmundmiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
op plugin init pulumi | ||
``` | ||
|
||
This should result in: | ||
|
||
``` | ||
|
||
edmundmiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Pulumi CLI | ||
Authenticate with Pulumi Personal Access Token. | ||
|
||
? Locate your Pulumi Personal Access Token: Search in 1Password... | ||
|
||
? Locate your Pulumi Personal Access Token: Pulumi Personal Access Token (Private) | ||
|
||
? Configure when the chosen credential(s) will be used to authenticate: Use automatically when in this directory or subdirectories | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Pulumi | ||
|
||
nf-core specific docs, links and guides. | ||
|
||
## Quick Start | ||
|
||
### Repo structure | ||
|
||
This repo is a "Monorepo", basically a bunch of smaller projects inside of one bigger project. | ||
|
||
```console | ||
tree -L 1 pulumi | ||
pulumi | ||
├── AWSMegatests | ||
├── github | ||
├── repo-backups | ||
├── sentieon-license-server | ||
└── test-datasets | ||
``` | ||
|
||
Each of these are their own projects. | ||
|
||
### Install Pulumi | ||
|
||
[Here's the official guide](https://www.pulumi.com/docs/clouds/aws/get-started/) | ||
|
||
### Working with this repo | ||
|
||
<!-- TODO Need someone fresh to run through this so we can see where the pain points are--> | ||
|
||
1. Open up the project you want to make a change to | ||
2. Make the change (Probably in `__main.py__`) | ||
3. If you have a Pulumi cloud account in the nf-core org `pulumi preview` and `pulumi up` should work locally | ||
4. Create a branch in the repo and make a PR, and a preview of the deployment should get ran. | ||
|
||
## Terminology | ||
|
||
Pulumi is pretty heavy on the terms and it was kinda confusing. A hierarchy kinda helps | ||
|
||
``` | ||
Projects | ||
├── Stacks | ||
├──── Deployments | ||
├──── Resources | ||
Environments | ||
``` | ||
|
||
### Projects | ||
|
||
Each directory in `pulumi` is a project. | ||
|
||
#### Stacks | ||
|
||
Each project can have multiple stacks. For example, `dev`, `prod`, `test`. | ||
|
||
Official quote: | ||
|
||
> What are projects and stacks? Pulumi projects and stacks let you organize Pulumi code. Consider a Pulumi project to be analogous to a GitHub repo—a single place for code—and a stack to be an instance of that code with a separate configuration. For instance, project foo may have multiple stacks for different deployment environments (dev, test, or prod), or perhaps for different cloud configurations (geographic region for example). See Organizing Projects and Stacks for some best practices on organizing your Pulumi projects and stacks. | ||
|
||
https://www.pulumi.com/docs/using-pulumi/organizing-projects-stacks/ | ||
|
||
##### Deployments | ||
|
||
Everytime you push to main in this repo a new deployment of the stack goes out. | ||
|
||
##### Resources | ||
|
||
These are individual pieces of infrastructure. An EC2 instance, a VPC, a GitHub repo, a GitHub team are some examples. | ||
|
||
### Environments | ||
|
||
This is Pulumi's hosted Secrete management. I'm thinking of these like, well "Environments". The nf-core AWS, the nf-core Azure, nf-core GCP, nf-core GitHub org, the nf-core-tf GitHub org. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pyc | ||
venv/ | ||
__pycache__/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
config: | ||
github:owner: nf-core-tf | ||
# GitHub token stored in 1Password: https://start.1password.com/open/i?a=O5GICFDKPNABLLVGMKBL5JWDWA&v=rdfcz6oy6qxxrc4clu467a7dmm&i=4ajrv44kc5lcbboa37fr5oydla&h=nf-core.1password.eu | ||
# 1Password provider configuration | ||
pulumi-onepassword:account: nf-core.1password.eu | ||
environment: | ||
- github-nf-core-tf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
config: | ||
github:owner: nf-core | ||
pulumi-onepassword:service_account_token: | ||
secure: AAABAOVuHjkvr7WBtuxqrIv2W0MkvP9DkIoAqXc2YKGgbjDWCQWGKrXV0wZbmA+064gFec1V6fPVSphDWm9CPx1yq1WkVSnfX4gpNvQKDtJUFq8dqf5Z0XrNljAEr3Tegp3J6L08wj0zvN8R/HfveoOysKzmn6iUuwCEoizq4Yeaz8z20lWpWorE0ICHo6AXBTTH/qGC1HSW9qFfnGtUPvmnNHt2mLhFjnrOGP6My9m3x3tF9no+ptFdWN54lhCyARcBhn6JP2MhEJ09UPXw+uxwFfj8euwgU/pRsqdu22pJLMLA5mOn5gShYcRFT4eaWoRiu9eYaElItfgB8HSKiWrk26+eDz1VvdjdqfcUeLp7X2BGxD50q3s5Y6IRvHKhYZhJzNGq57qhk4M8sYXcl3sDDLZcKuidv4/NfFlLcop5i4KJ8lVBz1jP0v6QQHWjGXT6U1CvX5EwhqemEO862V/5RRYfy/qX85aVv/Xf01lIosGF2v5C5888F0mh8kelKwZGoqm6K+5o1Cy8V/nfCdmRXCEo7DY0iBYa0LfLmv++587rMs0kS84ocBIm/CjdgLoG+zlJRZGXcA0BlJwcWGYPaJ5J/FNDagMNikjwnHmHcTU0nflbzaArC4GJKMboKhl0OFxU3Z8KmhPIv0tUQBEwceDCi3fbEFdgvgnP0kjbFOgT5LMht44M+0B/r7KWZWwYDmZI5t7Bh5FC+qWg+GUiK5MtpOOy9MNi0gC7WrvTH3vhXpGzfx41EOdu3LF6SycigF0IMznl784PimFX1fMxH+9pX29dUP5LxXkS2INs6QQQOcOmlRKZqEsgZOPA34fzyNQliIj1thmS6GrC80UZcAPQ9HZtvKHX2/EZnzjTKcNvQrwsbRlD2de05xRjKCstAwQJVusN0+t8zMzeqgYUe1+Y9+fQ+5nZ3+uQvj9OvLjHFGuzYUwYAbSnAWgWZgUQ4gXNac7MCR4uc5ENJOByE72yL0SuJrGbhPACOE0rZTx35L88+XD7wGbM0iJ8D/2QU5XOgvXaXHQZk4xxsmDg9hY7klQ1atf05eRD+nO9htMgbuvlWeA478vZo2+BbOjn5ziHlDvs9+/NNi3VmP+10WtEkecL71luvmnMyoxI2oouQfcT9xEWW7Xj830BddVO3lr+C5Sdkp27ZENGEhZruZtpzH4x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: github-repos | ||
runtime: | ||
name: python | ||
options: | ||
toolchain: uv | ||
virtualenv: .venv | ||
description: Managing nf-core GitHub repos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Repos | ||
|
||
Replaces the automatic rule enforcement from the [old Pipeline Health PHP code](https://github.com/nf-core/website/blob/old-site/public_html/pipeline_health.php), | ||
|
||
[Main GitHub Issue](https://github.com/nf-core/ops/issues/5) | ||
[Tracking Milestone](https://github.com/nf-core/ops/milestone/1) | ||
|
||
## Useful Docs | ||
|
||
- https://www.pulumi.com/registry/packages/github/api-docs/repository/ | ||
- [Old Pipeline Health PHP code](https://github.com/nf-core/website/blob/old-site/public_html/pipeline_health.php) | ||
- [New Pipeline Health page](https://github.com/nf-core/website/blob/main/sites/pipelines/src/pages/pipeline_health.astro) | ||
|
||
### Importing Repos | ||
|
||
```sh | ||
pulumi env run nf-core/github-prod -i pulumi import github:index/repository:Repository testpipeline testpipeline | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env python | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pulumi | ||
import pulumi_github as github | ||
|
||
|
||
nf_core_tf = github.Repository( | ||
"nf-core-tf", | ||
allow_merge_commit=False, | ||
allow_rebase_merge=False, | ||
allow_squash_merge=False, | ||
default_branch="main", | ||
description="Repository to host tool-specific module files for the Nextflow DSL2 community!", | ||
has_downloads=True, | ||
has_issues=True, | ||
has_projects=False, | ||
homepage_url="https://nf-co.re", | ||
merge_commit_message="", | ||
merge_commit_title="", | ||
name="modules", | ||
security_and_analysis=github.RepositorySecurityAndAnalysisArgs( | ||
secret_scanning=github.RepositorySecurityAndAnalysisSecretScanningArgs( | ||
status="disabled", | ||
), | ||
secret_scanning_push_protection=github.RepositorySecurityAndAnalysisSecretScanningPushProtectionArgs( | ||
status="disabled", | ||
), | ||
), | ||
squash_merge_commit_message="", | ||
squash_merge_commit_title="", | ||
topics=[ | ||
"nextflow", | ||
"pipelines", | ||
"nf-test", | ||
"modules", | ||
"nf-core", | ||
"dsl2", | ||
"workflows", | ||
], | ||
visibility="public", | ||
opts=pulumi.ResourceOptions(protect=True), | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- .github | ||
edmundmiller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- basic_training | ||
- configs | ||
- logos | ||
- modules | ||
- ops | ||
- prettier-plugin-nextflow | ||
- references | ||
- setup-nextflow | ||
- setup-nf-test | ||
- sublime | ||
- test-datasets | ||
- tools | ||
- vale | ||
- vscode-extensionpack | ||
- website |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env python | ||
|
||
|
||
# ... | ||
|
||
|
||
# ... |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.