Skip to content

Commit 0396fc8

Browse files
authored
Remove most references to the perflab upload token, including secret names and const references for it. (#4873)
Remove most references to the perflab upload token, including secret names and const references for it. This does not include updates for secret munger/sychronization runs as they will be covered in a follow-up PR removing multiple secret references.
1 parent 028daae commit 0396fc8

File tree

12 files changed

+18
-40
lines changed

12 files changed

+18
-40
lines changed

eng/pipelines/templates/run-performance-job-script-step.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ steps:
66
- script: $(Python) ${{ parameters.performanceRepoDir }}/scripts/run_performance_job.py ${{ join(' ', parameters.runPerformanceJobArgs) }}
77
displayName: Run performance job script
88
env:
9-
PerfCommandUploadToken: '$(PerfCommandUploadToken)'
10-
PerfCommandUploadTokenLinux: '$(PerfCommandUploadTokenLinux)'
119
HelixAccessToken: '$(HelixApiAccessToken)'

helix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
dockerImageName: helix_sender
3434
dockerCommand: python ./performance/scripts/run_performance_job.py --queue {{ queue }} --framework {{ framework }} --run-kind {{ kind }} --core-root-dir /performance/coreRoot --performance-repo-dir /performance/performance --architecture {{ architecture }} --os-group {{ osGroup }} --os-sub-group {{ osSubGroup }} {% if internal %}--internal{% endif %} --run-categories "{{ runCategories }}" {% if bdnArgs != blank and bdnArgs != empty %} --extra-bdn-args "{{ bdnArgs }}" {% endif %} --partition-count {{ partitionCount }} --project-file {{ projectFile }} {% if isScenario %} --is-scenario {% endif %} {% if isLocalBuild %} --local-build {% endif %}
3535
dockerContextDirectory: .
36-
arguments: '--env HelixAccessToken --env SYSTEM_ACCESSTOKEN --env PerfCommandUploadToken --env PerfCommandUploadTokenLinux'
36+
arguments: '--env HelixAccessToken --env SYSTEM_ACCESSTOKEN'
3737
environmentVariables:
3838
BUILD_BUILDNUMBER: '{{ buildNumber }}'
3939
BUILD_SOURCEVERSION: '{{ buildSourceVersion }}'

scripts/benchmarks_ci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from performance.common import get_repo_root_path, validate_supported_runtime, get_artifacts_directory, helixuploadroot
3434
from performance.logger import setup_loggers
3535
from performance.tracer import setup_tracing, enable_trace_console_exporter, get_tracer
36-
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_TOKEN_VAR, UPLOAD_QUEUE
36+
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_QUEUE
3737
from channel_map import ChannelMap
3838
from subprocess import CalledProcessError
3939
from glob import glob
@@ -382,7 +382,7 @@ def main(argv: List[str]):
382382
if args.upload_to_perflab_container:
383383
reports_globpath = os.path.join(artifacts_dir, '**', '*perf-lab-report.json')
384384
import upload
385-
upload_code = upload.upload(reports_globpath, upload_container, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
385+
upload_code = upload.upload(reports_globpath, upload_container, UPLOAD_QUEUE, UPLOAD_STORAGE_URI)
386386
getLogger().info("Benchmarks Upload Code: " + str(upload_code))
387387
if upload_code != 0:
388388
sys.exit(upload_code)

scripts/performance/constants.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
'Constant strings for scripts in the repo'
22

33
UPLOAD_CONTAINER = 'results'
4-
UPLOAD_TOKEN_VAR = 'PERFLAB_UPLOAD_TOKEN'
54
UPLOAD_STORAGE_URI = 'https://pvscmdupload.{}.core.windows.net'
65
UPLOAD_QUEUE = 'resultsqueue'
76
TENANT_ID = '72f988bf-86f1-41af-91ab-2d7cd011db47'
87
ARC_CLIENT_ID = 'a231f733-103b-46e9-b58a-9416edde0eb4'
9-
CERT_CLIENT_ID = '8c4b65ef-5a73-4d5a-a298-962d4a4ef7bc'
8+
CERT_CLIENT_ID = '8c4b65ef-5a73-4d5a-a298-962d4a4ef7bc'

scripts/run_performance_job.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class RunPerformanceJobArgs:
7373
built_app_dir: Optional[str] = None
7474
extra_bdn_args: Optional[str] = None
7575
run_categories: str = 'Libraries Runtime'
76-
perflab_upload_token: Optional[str] = None
7776
helix_access_token: Optional[str] = os.environ.get("HelixAccessToken")
7877
os_sub_group: Optional[str] = None
7978
project_file: Optional[str] = None
@@ -208,13 +207,6 @@ def get_pre_commands(args: RunPerformanceJobArgs, v8_version: str):
208207
"${V8_ENGINE_PATH} -e 'console.log(`V8 version: ${this.version()}`)'"
209208
]
210209

211-
# Ensure that the upload token is set so that the results can be uploaded to the storage account
212-
if args.internal:
213-
if args.os_group == "windows":
214-
install_prerequisites += [f"set \"PERFLAB_UPLOAD_TOKEN={args.perflab_upload_token}\""]
215-
else:
216-
install_prerequisites += [f"export PERFLAB_UPLOAD_TOKEN=\"{args.perflab_upload_token}\""]
217-
218210
# Add the install_prerequisites to the pre_commands
219211
if args.os_group == "windows":
220212
# TODO: Should we also give Windows the same treatment as linux and ensure that each command succeeds?
@@ -371,12 +363,6 @@ def run_performance_job(args: RunPerformanceJobArgs):
371363
if args.project_file is None:
372364
args.project_file = os.path.join(args.performance_repo_dir, "eng", "performance", "helix.proj")
373365

374-
if args.perflab_upload_token is None:
375-
env_var_name = "PerfCommandUploadToken" if args.os_group == "windows" else "PerfCommandUploadTokenLinux"
376-
args.perflab_upload_token = os.environ.get(env_var_name)
377-
if args.perflab_upload_token is None and args.internal:
378-
getLogger().info(f"{env_var_name} is not set. This may be needed for results to be uploaded.")
379-
380366
args.performance_repo_dir = os.path.abspath(args.performance_repo_dir)
381367

382368
mono_interpreter = args.codegen_type.lower() == "interpreter" and args.runtime_type == "mono"
@@ -456,7 +442,6 @@ def run_performance_job(args: RunPerformanceJobArgs):
456442
else:
457443
args.helix_access_token = None
458444
os.environ.pop("HelixAccessToken", None) # in case the environment variable is set on the system already
459-
args.perflab_upload_token = ""
460445
extra_bdn_arguments += [
461446
"--iterationCount", "1",
462447
"--warmupCount", "0",
@@ -1204,7 +1189,6 @@ def main(argv: List[str]):
12041189
"--versions-props-path": "versions_props_path",
12051190
"--browser-versions-props-path": "browser_versions_props_path",
12061191
"--built-app-dir": "built_app_dir",
1207-
"--perflab-upload-token": "perflab_upload_token",
12081192
"--helix-access-token": "helix_access_token",
12091193
"--project-file": "project_file",
12101194
"--build-repository-name": "build_repository_name",

scripts/upload.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def get_unique_name(filename: str, unique_id: str) -> str:
2727
newname = "{0}-perf-lab-report.json".format(randint(1000, 9999))
2828
return newname
2929

30-
def upload(globpath: str, container: str, queue: str, sas_token_env: str, storage_account_uri: str):
30+
def upload(globpath: str, container: str, queue: str, storage_account_uri: str):
3131
try:
3232
credential = None
3333
try:
@@ -50,9 +50,7 @@ def upload(globpath: str, container: str, queue: str, sas_token_env: str, storag
5050
except Exception as ex:
5151
credential = None
5252
if credential is None:
53-
getLogger().error("Unable to authenticate with managed identity or certificates.")
54-
getLogger().info("Falling back to environment variable.")
55-
credential = os.getenv(sas_token_env)
53+
raise RuntimeError("Authentication failed with managed identity and certificates. No valid authentication method available.")
5654

5755
files = glob(globpath, recursive=True)
5856
any_upload_or_queue_failed = False

src/scenarios/shared/androidinstrumentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from logging import getLogger
88
from shutil import copytree
99
from performance.common import runninginlab, RunCommand
10-
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_TOKEN_VAR, UPLOAD_QUEUE
10+
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_QUEUE
1111
from shared.util import helixuploaddir, xharnesscommand, xharness_adb
1212
from shared.const import *
1313
from subprocess import CalledProcessError
@@ -139,7 +139,7 @@ def runtests(self, packagepath: str, packagename: str, instrumentationname: str,
139139
TRACEDIR,
140140
'**',
141141
'*perf-lab-report.json')
142-
upload_code = upload.upload(globpath, UPLOAD_CONTAINER, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
142+
upload_code = upload.upload(globpath, UPLOAD_CONTAINER, UPLOAD_QUEUE, UPLOAD_STORAGE_URI)
143143
getLogger().info("Device Benchmarks Upload Code: " + str(upload_code))
144144
if upload_code != 0:
145145
sys.exit(upload_code)

src/scenarios/shared/devicepowerconsumption.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from shutil import copytree
1111
import time
1212
from performance.common import extension, helixpayload, runninginlab, get_artifacts_directory, get_packages_directory, RunCommand
13-
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_TOKEN_VAR, UPLOAD_QUEUE
13+
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_QUEUE
1414
from dotnet import CSharpProject, CSharpProjFile
1515
from shared import const
1616
from shared.androidhelper import AndroidHelper
@@ -93,7 +93,7 @@ def parsetraces(self, traits: TestTraits):
9393
copytree(TRACEDIR, os.path.join(helix_upload_dir, 'traces'))
9494
if traits.upload_to_perflab_container:
9595
import upload
96-
upload.upload(self.reportjson, upload_container, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
96+
upload.upload(self.reportjson, upload_container, UPLOAD_QUEUE, UPLOAD_STORAGE_URI)
9797

9898
def runtestsandroid(self, packagepath: str, packagename: str, testiterations: int, runtimeseconds: int, closeToStartDelay: int, traits: TestTraits):
9999
getLogger().info("Clearing potential previous run nettraces")

src/scenarios/shared/memoryconsumption.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from logging import getLogger
77
from shutil import copytree
88
from performance.common import extension, helixpayload, runninginlab, get_artifacts_directory, get_packages_directory, RunCommand
9-
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_TOKEN_VAR, UPLOAD_QUEUE
9+
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_QUEUE
1010
from dotnet import CSharpProject, CSharpProjFile
1111
from shared.util import helixworkitempayload, helixuploaddir, getruntimeidentifier
1212
from shared.const import *
@@ -86,7 +86,7 @@ def parsetraces(self, traits: TestTraits):
8686
copytree(TRACEDIR, os.path.join(helix_upload_dir, 'traces'))
8787
if traits.upload_to_perflab_container:
8888
import upload
89-
upload.upload(self.reportjson, upload_container, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
89+
upload.upload(self.reportjson, upload_container, UPLOAD_QUEUE, UPLOAD_STORAGE_URI)
9090

9191
def runtests(self, traits: TestTraits):
9292
'''
@@ -159,7 +159,7 @@ def runtests(self, traits: TestTraits):
159159
copytree(TRACEDIR, os.path.join(helix_upload_dir, 'traces'))
160160
if traits.upload_to_perflab_container:
161161
import upload
162-
upload_code = upload.upload(self.reportjson, upload_container, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
162+
upload_code = upload.upload(self.reportjson, upload_container, UPLOAD_QUEUE, UPLOAD_STORAGE_URI)
163163
getLogger().info("memoryconsumption Upload Code: " + str(upload_code))
164164
if upload_code != 0:
165165
sys.exit(upload_code)

src/scenarios/shared/sod.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from shutil import copytree, copy
99
from typing import Optional
1010
from performance.common import helixpayload, extension, runninginlab, get_artifacts_directory, get_packages_directory, RunCommand
11-
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_TOKEN_VAR, UPLOAD_QUEUE
11+
from performance.constants import UPLOAD_CONTAINER, UPLOAD_STORAGE_URI, UPLOAD_QUEUE
1212
from dotnet import CSharpProject, CSharpProjFile
1313
from shared.util import helixworkitempayload, helixuploaddir, getruntimeidentifier
1414
from shared.const import *
@@ -97,7 +97,7 @@ def runtests(self, scenarioname: Optional[str], dirs: str, upload_to_perflab_con
9797

9898
if upload_to_perflab_container:
9999
import upload
100-
upload_code = upload.upload(reportjson, UPLOAD_CONTAINER, UPLOAD_QUEUE, UPLOAD_TOKEN_VAR, UPLOAD_STORAGE_URI)
100+
upload_code = upload.upload(reportjson, UPLOAD_CONTAINER, UPLOAD_QUEUE, UPLOAD_STORAGE_URI)
101101
getLogger().info("SoD Upload Code: " + str(upload_code))
102102
if upload_code != 0:
103103
sys.exit(upload_code)

0 commit comments

Comments
 (0)