Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
DO NOT MERGE, poc for enabling workflows by label
Signed-off-by: Eli Uriegas <[email protected]>

[ghstack-poisoned]
  • Loading branch information
seemethere committed Jul 15, 2021
commit e13b10bc50bece4165b3b558f14fc4e36de59b90
3 changes: 3 additions & 0 deletions .github/scripts/generate_ci_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def PyTorchLinuxWorkflow(
enable_slow_test: YamlShellBool = "''",
num_test_shards: int = 1,
is_scheduled: Optional[str] = None,
enabled_by_label: str = "",
) -> PyTorchWorkflow:
return {
"build_environment": build_environment,
Expand All @@ -75,6 +76,7 @@ def PyTorchLinuxWorkflow(
"enable_nogpu_no_avx2_test": enable_nogpu_no_avx2_test,
"enable_slow_test": enable_slow_test,
"num_test_shards": num_test_shards,
"enabled_by_label": enabled_by_label,
}


Expand Down Expand Up @@ -182,6 +184,7 @@ def generate_workflow_file(
build_environment="pytorch-linux-xenial-cuda11.1-cudnn8-py3.6-gcc7",
docker_image_base=f"{DOCKER_REGISTRY}/pytorch/pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7",
test_runner_type=LINUX_CUDA_TEST_RUNNER,
enabled_by_label="cuda11",
num_test_shards=2,
),
# PyTorchLinuxWorkflow(
Expand Down
17 changes: 16 additions & 1 deletion .github/templates/linux_ci_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Linux CI (!{{ build_environment }})

on:
# TODO: Enable pull_request builds when we can verify capacity can be met by auto-scalers
{%- if on_pull_request %}
{%- if on_pull_request or enabled_by_label != "" %}
pull_request:
{%- endif %}
{%- if is_scheduled %}
Expand Down Expand Up @@ -36,11 +36,23 @@ concurrency:
cancel-in-progress: true

jobs:
{%- if enabled_by_label != "" %}
should-run:
runs-ons: ubuntu-latest
if: >-
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, "!{{enabled_by_label}}")
steps:
- run: echo "noop"
{%- endif %}
calculate-docker-image:
runs-on: linux.2xlarge
env:
DOCKER_BUILDKIT: 1
timeout-minutes: 90
{%- if enabled_by_label != "" %}
needs: should-run
{%- endif %}
outputs:
docker_image: ${{ steps.calculate-tag.outputs.docker_image }}
steps:
Expand Down Expand Up @@ -224,6 +236,9 @@ jobs:
render-matrix: ${{ steps.set-matrix.outputs.render-matrix }}
container:
image: python:3.9
{%- if enabled_by_label != "" %}
needs: should-run
{%- endif %}
steps:
- name: Install dependencies
run: pip install typing-extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Linux CI (pytorch-linux-xenial-cuda11.1-cudnn8-py3.6-gcc7)

on:
# TODO: Enable pull_request builds when we can verify capacity can be met by auto-scalers
pull_request:
push:
branches:
- master
Expand All @@ -26,11 +27,19 @@ concurrency:
cancel-in-progress: true

jobs:
should-run:
runs-ons: ubuntu-latest
if: >-
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, "cuda11")
steps:
- run: echo "noop"
calculate-docker-image:
runs-on: linux.2xlarge
env:
DOCKER_BUILDKIT: 1
timeout-minutes: 90
needs: should-run
outputs:
docker_image: ${{ steps.calculate-tag.outputs.docker_image }}
steps:
Expand Down Expand Up @@ -212,6 +221,7 @@ jobs:
render-matrix: ${{ steps.set-matrix.outputs.render-matrix }}
container:
image: python:3.9
needs: should-run
steps:
- name: Install dependencies
run: pip install typing-extensions
Expand Down