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

Add support for Cirun on self-hosted GHA runners #1703

Merged
merged 75 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
e6dcdff
Add support for cirun on self-hosted GHA runners
jaimergp Dec 19, 2022
fd031cd
pre-commit
jaimergp Dec 19, 2022
7836cce
add more labels and runners
jaimergp Dec 27, 2022
2598d9a
produce .cirun.yml
jaimergp Jan 9, 2023
e6158f9
update runner config
jaimergp Jan 9, 2023
5f96e5e
refactor os-matrix building in gha template
jaimergp Jan 9, 2023
a366a1f
update vm [ci skip]
jaimergp Jan 10, 2023
4104525
default to gpu_large
jaimergp Jan 23, 2023
d6ae11a
support cancel_in_progress
jaimergp Jan 23, 2023
9e01400
raw
jaimergp Jan 23, 2023
dfb99f2
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
jaimergp Feb 9, 2023
adc5426
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
jaimergp Jul 26, 2023
bc96c16
add stubs for opt-in ci registration
jaimergp Jul 26, 2023
d3258f9
TEMP
aktech Aug 5, 2023
f5dad75
add utilities to handle adding cirun
aktech Aug 6, 2023
eb8811e
move cirun stuff to cirun utils
aktech Aug 17, 2023
8d4a674
Merge branch 'main' into gha-self-hosted-cirun
aktech Aug 17, 2023
f672f73
some cleanups
aktech Aug 21, 2023
156e27d
undo conda-build version change
aktech Aug 21, 2023
0a7bdd9
make precommit happy
aktech Aug 22, 2023
7b0c3e3
add installation id
aktech Aug 22, 2023
fd37814
add policy args
aktech Aug 26, 2023
e72cb95
set installation id as environment variable
aktech Aug 26, 2023
9126d1c
Merge branch 'main' into gha-self-hosted-cirun
aktech Aug 26, 2023
832f85d
move conda-forge to environ variable
aktech Aug 26, 2023
d384958
use owner/org from cli instead of env var
aktech Aug 26, 2023
d084434
minor fixes
aktech Aug 26, 2023
6355aa8
assert installation id
aktech Aug 27, 2023
37d0252
add some more logging
aktech Aug 27, 2023
94aac9e
log cirun response
aktech Aug 27, 2023
c2db57e
remove commented out code and cirun file json
aktech Aug 27, 2023
63c566a
remove .cirun.yml template reference
aktech Aug 27, 2023
ce81aa2
pre-commit fixes
aktech Aug 28, 2023
829201e
undo changes to github actions template
aktech Aug 28, 2023
c68e3b0
undo changes to configure feedstock
aktech Aug 28, 2023
03b5cea
remove stub travis func
aktech Aug 28, 2023
d4a594c
undo mode change
aktech Aug 28, 2023
dee3843
Undo removal of github actions template
jaimergp Sep 8, 2023
c66aa34
Merge branch 'main' into gha-self-hosted-cirun
aktech Sep 8, 2023
655aec2
pre-commit fixes
aktech Sep 8, 2023
cf9e9bf
not available for travis
aktech Sep 8, 2023
589fb8a
add a note about getting installation id
aktech Sep 8, 2023
117fc1e
cache cirun client
aktech Sep 8, 2023
c02cbdd
add type hints, docs
aktech Sep 8, 2023
e7257d7
set policy args to None by default
aktech Sep 8, 2023
3876bbf
set default value for cirun_resources to iterable
aktech Sep 8, 2023
85390fa
make polcy args as optional
aktech Sep 8, 2023
2204933
precommit fixes
aktech Sep 8, 2023
357e594
Update conda_smithy/cirun_utils.py
aktech Sep 8, 2023
97456f4
remove reference to .cirun.yml template
aktech Sep 8, 2023
f42717c
add link to client docs
aktech Sep 8, 2023
ab740b8
remove cirun_runners from forge config
aktech Sep 8, 2023
36e986d
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
jaimergp Oct 4, 2023
3472ee5
fix ppc64le name
jaimergp Oct 4, 2023
84cc27f
add self hosted timeout minutes
jaimergp Oct 4, 2023
af967c9
add more platform labels
jaimergp Oct 6, 2023
9405540
move labels config to configure_feedstock
jaimergp Oct 17, 2023
4c4c898
pre-commit
jaimergp Oct 17, 2023
98eb99c
Use recipe/conda_build_config.yaml for labels for more fine-grained c…
isuruf Oct 20, 2023
f480723
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
isuruf Oct 20, 2023
3c07948
Keep github_actions_labels only if self-hosted is turned on
isuruf Oct 20, 2023
c29e9cd
Bring back free_disk_space
isuruf Oct 20, 2023
41d65b2
Support other orgs for cirun
isuruf Oct 23, 2023
d631fbd
pre-commit
isuruf Oct 23, 2023
549d7b9
Move import to top-level
isuruf Oct 31, 2023
83079c4
fix cirun installation id
isuruf Oct 31, 2023
fc4a0b0
formatting
isuruf Oct 31, 2023
87f7004
Add news entry
isuruf Oct 31, 2023
a72ca1e
Fix default values
isuruf Oct 31, 2023
20252d3
fix news
isuruf Oct 31, 2023
e50cf3a
list of lists for zipping
isuruf Oct 31, 2023
9ac2df7
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
isuruf Nov 6, 2023
2bbcd4d
change default value of cancel_in_progress
isuruf Nov 6, 2023
64e0e49
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
isuruf Nov 6, 2023
62d2a4b
pre-commit
isuruf Nov 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions conda_smithy/cirun_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,25 @@

from cirun import Cirun

# To get this id, got to https://github.com/organizations/<ORG-NAME>/settings/installations
# and then click on the Configure button next to Cirun Application, then copy
# the installation id from the URL, it would look something like:
# https://github.com/organizations/conda-forge/settings/installations/18453316
CIRUN_INSTALLATION_ID = os.environ.get("CIRUN_INSTALLATION_ID", 18453316)

@lru_cache
def get_cirun_installation_id(owner: str) -> int:
# This ID needs a token with admin: org privileges.
# Hard-code instead for easier use
if owner == "conda-forge":
return 18453316
else:
from .github import gh_token, Github
jaimergp marked this conversation as resolved.
Show resolved Hide resolved
gh = Github(gh_token)
user = gh.get_user()
if (user.login == owner):
isuruf marked this conversation as resolved.
Show resolved Hide resolved
user_or_org = user
else:
user_or_org = gh.get_organization(owner)
for inst in user_or_org.get_installations:
if inst.raw_data["app_slug"] == "cirun-application":
return inst.app_id
isuruf marked this conversation as resolved.
Show resolved Hide resolved
raise ValueError(f"cirun not found for owner {owner}")


def enable_cirun_for_project(owner: str, repo: str) -> Dict[str, Any]:
Expand Down
Loading