CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ !{{ common.parse_ref() }}
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
python3 -mcodecov
{%- endif %}
!{{ common.upload_test_reports(name='linux') }}
- !{{ common.parse_ref() }}
!{{ common.upload_test_statistics(build_environment) }}
!{{ common.teardown_ec2_linux() }}
{% endblock %}
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
- name: Output disk space left
run: |
sudo df -H
+ - name: Parse ref
+ id: parse-ref
+ run: .github/scripts/parse_ref.py
- name: Test
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
+ IS_GHA: 1
+ CIRCLE_BRANCH: ${{ steps.parse-ref.outputs.branch }}
+ CIRCLE_PR_NUMBER: ${{ github.event.pull_request.number }}
+ CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
+ AWS_DEFAULT_REGION: us-east-1
run: |
if [[ $TEST_CONFIG == 'multigpu' ]]; then
TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh
-e CUSTOM_TEST_ARTIFACT_BUILD_DIR \
-e GITHUB_ACTIONS \
-e IN_CI \
+ -e IS_GHA \
+ -e CIRCLE_BRANCH \
+ -e CIRCLE_SHA1 \
+ -e CIRCLE_PR_NUMBER \
+ -e AWS_DEFAULT_REGION \
-e IN_WHEEL_TEST \
-e SHARD_NUMBER \
-e JOB_BASE_NAME \
if-no-files-found: error
path:
test-reports-*.zip
- - name: Parse ref
- id: parse-ref
- run: .github/scripts/parse_ref.py
- name: Display and upload test statistics (Click Me)
if: always()
# temporary hack: set CIRCLE_* vars, until we update
CIRCLE_SHA1: ${{ github.event.pull_request.head.sha || github.sha }}
CIRCLE_TAG: ${{ steps.parse-ref.outputs.tag }}
CIRCLE_WORKFLOW_ID: '${{ github.run_id }}_${{ github.run_number }}'
- GITHUB_WORKFLOW_RUN_ID: '${{ github.run_id }}'
run: |
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
export COMMIT_TIME
--- /dev/null
+import subprocess
+import sys
+import unittest
+import pathlib
+
+from torch.testing._internal.common_utils import TestCase, run_tests, IS_LINUX, IS_IN_CI
+
+
+REPO_ROOT = pathlib.Path(__file__).resolve().parent.parent
+
+try:
+ # Just in case PyTorch was not built in 'develop' mode
+ sys.path.append(str(REPO_ROOT))
+ from tools.stats.scribe import rds_write, register_rds_schema
+except ImportError:
+ register_rds_schema = None
+ rds_write = None
+
+
+# these tests could eventually be changed to fail if the import/init
+# time is greater than a certain threshold, but for now we just use them
+# as a way to track the duration of `import torch` in our ossci-metrics
+# S3 bucket (see tools/stats/print_test_stats.py)
+class TestImportTime(TestCase):
+ def test_time_import_torch(self):
+ TestCase.runWithPytorchAPIUsageStderr("import torch")
+
+ def test_time_cuda_device_count(self):
+ TestCase.runWithPytorchAPIUsageStderr(
+ "import torch; torch.cuda.device_count()",
+ )
+
+ @unittest.skipIf(not IS_LINUX, "Memory test is only implemented for Linux")
+ @unittest.skipIf(not IS_IN_CI, "Memory test only runs in CI")
+ def test_peak_memory(self):
+ def profile(module, name):
+ command = f"import {module}; import resource; print(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss)"
+ result = subprocess.run(
+ [sys.executable, "-c", command],
+ stdout=subprocess.PIPE,
+ )
+ max_rss = int(result.stdout.decode().strip())
+
+ return {
+ "test_name": name,
+ "peak_memory_bytes": max_rss,
+ }
+
+ data = profile("torch", "pytorch")
+ baseline = profile("sys", "baseline")
+ rds_write(
+ "import_stats", [data, baseline]
+ )
+
+
+if __name__ == "__main__":
+ if register_rds_schema and IS_IN_CI:
+ register_rds_schema(
+ "import_stats",
+ {
+ "test_name": "string",
+ "peak_memory_bytes": "int",
+ "time_ms": "int",
+ },
+ )
+
+ run_tests()
+++ /dev/null
-from torch.testing._internal.common_utils import TestCase, run_tests
-
-
-# these tests could eventually be changed to fail if the import/init
-# time is greater than a certain threshold, but for now we just use them
-# as a way to track the duration of `import torch` in our ossci-metrics
-# S3 bucket (see tools/stats/print_test_stats.py)
-class TestImportTime(TestCase):
- def test_time_import_torch(self):
- TestCase.runWithPytorchAPIUsageStderr('import torch')
-
- def test_time_cuda_device_count(self):
- TestCase.runWithPytorchAPIUsageStderr(
- 'import torch; torch.cuda.device_count()',
- )
-
-
-if __name__ == '__main__':
- run_tests()
import bz2
import os
import json
-from typing import Dict, Any, List, Union
+from typing import Dict, Any, List, Union, Optional
_lambda_client = None
def register_rds_schema(table_name: str, schema: Dict[str, str]) -> None:
+ """
+ Register a table in RDS so it can be written to later on with 'rds_write'.
+ 'schema' should be a mapping of field names -> types, where supported types
+ are 'int' and 'string'.
+
+ Metadata fields such as pr, ref, branch, workflow_id, and build_environment
+ will be added automatically.
+ """
base = {
"pr": "string",
"ref": "string",
def schema_from_sample(data: Dict[str, Any]) -> Dict[str, str]:
+ """
+ Extract a schema compatible with 'register_rds_schema' from data.
+ """
schema = {}
for key, value in data.items():
if isinstance(value, str):
def rds_query(queries: Union[Query, List[Query]]) -> Any:
+ """
+ Execute a simple read query on RDS. Queries should be of the form below,
+ where everything except 'table_name' and 'fields' is optional.
+
+ {
+ "table_name": "my_table",
+ "fields": ["something", "something_else"],
+ "where": [
+ {
+ "field": "something",
+ "value": 10
+ }
+ ],
+ "group_by": ["something"],
+ "order_by": ["something"],
+ "limit": 5,
+ }
+ """
if not isinstance(queries, list):
queries = [queries]
def rds_saved_query(query_names: Union[str, List[str]]) -> Any:
+ """
+ Execute a hardcoded RDS query by name. See
+ https://github.com/pytorch/test-infra/blob/main/aws/lambda/rds-proxy/lambda_function.py#L52
+ for available queries or submit a PR there to add a new one.
+ """
if not isinstance(query_names, list):
query_names = [query_names]
def rds_write(
- table_name: str, values_list: List[Dict[str, Any]], only_on_master: bool = True
+ table_name: str,
+ values_list: List[Dict[str, Any]],
+ only_on_master: bool = True,
+ only_on_jobs: Optional[List[str]] = None,
) -> None:
+ """
+ Note: Only works from GitHub Actions CI runners
+
+ Write a set of entries to a particular RDS table. 'table_name' should be
+ a table registered via 'register_rds_schema' prior to calling rds_write.
+ 'values_list' should be a list of dictionaries that map field names to
+ values.
+ """
sprint("Writing for", os.getenv("CIRCLE_PR_NUMBER"))
is_master = os.getenv("CIRCLE_PR_NUMBER", "").strip() == ""
if only_on_master and not is_master:
if pr is not None and pr.strip() == "":
pr = None
+ build_environment = os.environ.get("BUILD_ENVIRONMENT", "").split()[0]
+ if only_on_jobs is not None and build_environment not in only_on_jobs:
+ sprint(f"Skipping write since {build_environment} is not in {only_on_jobs}")
+ return
+
base = {
"pr": pr,
"ref": os.getenv("CIRCLE_SHA1"),
"branch": os.getenv("CIRCLE_BRANCH"),
- "workflow_id": os.getenv("GITHUB_WORKFLOW_RUN_ID"),
- "build_environment": os.environ.get("BUILD_ENVIRONMENT", "").split()[0],
+ "workflow_id": os.getenv("GITHUB_RUN_ID"),
+ "build_environment": build_environment,
}
events = []