|
1 | 1 | on: |
2 | 2 | pull_request: |
3 | 3 | push: |
4 | | - branches: [ main ] |
| 4 | + branches: [main] |
5 | 5 | workflow_call: |
6 | 6 |
|
7 | 7 | jobs: |
|
63 | 63 | # Pulled from instance metadata endpoint for EC2 |
64 | 64 | # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html |
65 | 65 | category=$1 |
66 | | - curl -fsSL "http://169.254.169.254/latest/meta-data/${category}" |
| 66 | + curl -H "X-aws-ec2-metadata-token: $(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30")" -fsSL "http://169.254.169.254/latest/meta-data/${category}" |
67 | 67 | } |
68 | 68 | echo "ami-id: $(get_ec2_metadata ami-id)" |
69 | 69 | echo "instance-id: $(get_ec2_metadata instance-id)" |
@@ -92,51 +92,51 @@ jobs: |
92 | 92 | - name: Upload coverage to codecov |
93 | 93 | uses: codecov/codecov-action@v2 |
94 | 94 |
|
95 | | -# Disabled to unblock TNT OSS release. |
96 | | -# |
97 | | -# s3_integration_test: |
98 | | -# if: github.event.pull_request.head.repo.fork == false |
99 | | -# runs-on: ubuntu-latest |
100 | | -# strategy: |
101 | | -# matrix: |
102 | | -# python-version: [3.8] |
103 | | -# # These permissions are needed to interact with GitHub's OIDC Token endpoint |
104 | | -# permissions: |
105 | | -# id-token: write |
106 | | -# contents: read |
107 | | -# steps: |
108 | | -# - name: Configure AWS Credentials |
109 | | -# uses: aws-actions/configure-aws-credentials@v1 |
110 | | -# with: |
111 | | -# role-to-assume: ${{ secrets.AWS_ROLE_ARN }} |
112 | | -# aws-region: us-east-1 |
113 | | -# - name: Set environment variables |
114 | | -# run: echo "TORCHSNAPSHOT_ENABLE_AWS_TEST=1" >> $GITHUB_ENV |
115 | | -# - name: Check out repo |
116 | | -# uses: actions/checkout@v2 |
117 | | -# - name: Setup conda env |
118 | | -# uses: conda-incubator/setup-miniconda@v2 |
119 | | -# with: |
120 | | -# miniconda-version: "latest" |
121 | | -# activate-environment: test |
122 | | -# python-version: ${{ matrix.python-version }} |
123 | | -# - name: Install dependencies |
124 | | -# shell: bash -l {0} |
125 | | -# run: | |
126 | | -# set -eux |
127 | | -# conda activate test |
128 | | -# conda install pytorch cpuonly -c pytorch-nightly |
129 | | -# pip install -r requirements.txt |
130 | | -# pip install -r dev-requirements.txt |
131 | | -# pip install --no-build-isolation -e ".[dev]" |
132 | | -# - name: Run unit tests with coverage |
133 | | -# shell: bash -l {0} |
134 | | -# run: | |
135 | | -# set -eux |
136 | | -# conda activate test |
137 | | -# pytest --timeout=300 --cov=. --cov-report xml -vv -rA -m s3_integration_test tests |
138 | | -# - name: Upload coverage to codecov |
139 | | -# uses: codecov/codecov-action@v2 |
| 95 | + # Disabled to unblock TNT OSS release. |
| 96 | + # |
| 97 | + # s3_integration_test: |
| 98 | + # if: github.event.pull_request.head.repo.fork == false |
| 99 | + # runs-on: ubuntu-latest |
| 100 | + # strategy: |
| 101 | + # matrix: |
| 102 | + # python-version: [3.8] |
| 103 | + # # These permissions are needed to interact with GitHub's OIDC Token endpoint |
| 104 | + # permissions: |
| 105 | + # id-token: write |
| 106 | + # contents: read |
| 107 | + # steps: |
| 108 | + # - name: Configure AWS Credentials |
| 109 | + # uses: aws-actions/configure-aws-credentials@v1 |
| 110 | + # with: |
| 111 | + # role-to-assume: ${{ secrets.AWS_ROLE_ARN }} |
| 112 | + # aws-region: us-east-1 |
| 113 | + # - name: Set environment variables |
| 114 | + # run: echo "TORCHSNAPSHOT_ENABLE_AWS_TEST=1" >> $GITHUB_ENV |
| 115 | + # - name: Check out repo |
| 116 | + # uses: actions/checkout@v2 |
| 117 | + # - name: Setup conda env |
| 118 | + # uses: conda-incubator/setup-miniconda@v2 |
| 119 | + # with: |
| 120 | + # miniconda-version: "latest" |
| 121 | + # activate-environment: test |
| 122 | + # python-version: ${{ matrix.python-version }} |
| 123 | + # - name: Install dependencies |
| 124 | + # shell: bash -l {0} |
| 125 | + # run: | |
| 126 | + # set -eux |
| 127 | + # conda activate test |
| 128 | + # conda install pytorch cpuonly -c pytorch-nightly |
| 129 | + # pip install -r requirements.txt |
| 130 | + # pip install -r dev-requirements.txt |
| 131 | + # pip install --no-build-isolation -e ".[dev]" |
| 132 | + # - name: Run unit tests with coverage |
| 133 | + # shell: bash -l {0} |
| 134 | + # run: | |
| 135 | + # set -eux |
| 136 | + # conda activate test |
| 137 | + # pytest --timeout=300 --cov=. --cov-report xml -vv -rA -m s3_integration_test tests |
| 138 | + # - name: Upload coverage to codecov |
| 139 | + # uses: codecov/codecov-action@v2 |
140 | 140 |
|
141 | 141 | gcs_integration_tests: |
142 | 142 | if: github.event.pull_request.head.repo.fork == false |
|
0 commit comments