-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from nf-core/stats
Steampipe PoC
- Loading branch information
Showing
12 changed files
with
991 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,42 @@ | ||
name: Stats | ||
|
||
on: | ||
schedule: # every day at 2am and 2pm | ||
- cron: "0 2,14 * * *" | ||
pull_request: | ||
paths: | ||
- "stats/steampipe/**" | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: [update-website] | ||
|
||
env: | ||
TWITTER_BEARER_TOKEN: ${{secrets.TWITTER_BEARER_TOKEN}} | ||
GITHUB_TOKEN: ${{secrets.STEAMPIPE_GH_TOKEN}} | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | ||
|
||
jobs: | ||
update: | ||
name: Update | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
cache: true | ||
manifest-path: "stats/steampipe/pixi.toml" | ||
- run: pixi run download_hf | ||
working-directory: ./stats/steampipe/ | ||
- run: pixi run plugins | ||
working-directory: ./stats/steampipe/ | ||
# FIXME Throw error if failure to connect | ||
- run: pixi run github_hc | ||
working-directory: ./stats/steampipe/ | ||
- run: pixi run twitter_hc | ||
working-directory: ./stats/steampipe/ | ||
- run: pixi run slack_hc | ||
working-directory: ./stats/steampipe/ | ||
# TODO - run: pixi run slack | ||
- run: pixi run upload_hf | ||
working-directory: ./stats/steampipe/ |
This file contains 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,8 @@ | ||
watch_file pixi.lock | ||
eval "$(pixi shell-hook)" | ||
|
||
export OP_ACCOUNT="nf-core" | ||
export TWITTER_BEARER_TOKEN=$(op read "op://Shared/3yyagrpjil6orirpdr7xslerfi/Bearer token") | ||
# export GITHUB_TOKEN=$(op read "op://Private/GitHub Personal Access Token/token") | ||
# export HF_TOKEN=$(op read "op://Private/Hugging Face API Token/user access token") | ||
export SLACK_TOKEN=$(op read "op://Employee/Slack Steampipe CLI OAuth Token/credential") |
This file contains 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 @@ | ||
# GitHub syntax highlighting | ||
pixi.lock linguist-language=YAML linguist-generated=true |
This file contains 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 @@ | ||
# pixi environments | ||
.pixi | ||
*.egg-info | ||
hf_stats/ |
This file contains 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,14 @@ | ||
![GitHub Stats](https://img.shields.io/endpoint?url=https%3A%2F%2Fhealthchecks.io%2Fb%2F2%2Fd2febac8-1214-4c89-aa9c-a3f2c77b3995.shields) | ||
![Twitter Stats](https://img.shields.io/endpoint?url=https%3A%2F%2Fhealthchecks.io%2Fb%2F2%2F5fd77e2f-16ea-4514-bd06-a49e710aab37.shields) | ||
|
||
## Notes | ||
|
||
https://steampipe.io/docs/integrations/gitpod | ||
https://steampipe.io/docs/integrations/github_actions/installing_steampipe | ||
|
||
https://hub.steampipe.io/plugins/turbot/github | ||
|
||
## Plans | ||
|
||
Okay so first we're going to go from Steam pipe and then Steam pipe will then run these | ||
queries that'll all get kicked off by GitHub Actions cronjob and that cron job will run a healthcheck ping at the end, and if it doesn't ping it'll hit us with a slack notification |
This file contains 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,14 @@ | ||
select | ||
followers, | ||
teams_total_count as teams_count, | ||
members_with_role_total_count as member_count, | ||
repositories_total_count as repo_count, | ||
repositories_total_disk_usage as disk_usage | ||
from | ||
github_organization | ||
where | ||
login = 'nf-core'; | ||
|
||
-- https://hub.steampipe.io/plugins/turbot/github/tables/github_organization_collaborator | ||
-- https://hub.steampipe.io/plugins/turbot/github/tables/github_stargazer | ||
-- https://hub.steampipe.io/plugins/turbot/github/tables/github_traffic_view_daily |
Oops, something went wrong.