Skip to content

Commit 0c327e8

Browse files
committed
upgrade metadata call to use IMDSv2, only supported version soon
1 parent f98742e commit 0c327e8

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

.github/workflows/run_tests.yaml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
pull_request:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
workflow_call:
66

77
jobs:
@@ -63,7 +63,7 @@ jobs:
6363
# Pulled from instance metadata endpoint for EC2
6464
# see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
6565
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}"
6767
}
6868
echo "ami-id: $(get_ec2_metadata ami-id)"
6969
echo "instance-id: $(get_ec2_metadata instance-id)"
@@ -92,51 +92,51 @@ jobs:
9292
- name: Upload coverage to codecov
9393
uses: codecov/codecov-action@v2
9494

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
140140

141141
gcs_integration_tests:
142142
if: github.event.pull_request.head.repo.fork == false

0 commit comments

Comments
 (0)