Skip to content

Instantly share code, notes, and snippets.

@grenade
Last active December 4, 2020 06:24
Show Gist options
  • Save grenade/d681a022c0fc525f6147d1bad99e9f53 to your computer and use it in GitHub Desktop.
Save grenade/d681a022c0fc525f6147d1bad99e9f53 to your computer and use it in GitHub Desktop.
---
provisionerId: gecko-1
workerType: b-linux
priority: highest
payload:
image: 'python:3-alpine'
features:
taskclusterProxy: true
command:
- /bin/sh
- '-c'
- >-
wget --quiet --output-document -
https://gist.githubusercontent.com/grenade/d681a022c0fc525f6147d1bad99e9f53/raw/debug.sh
| sh
maxRunTime: 630
metadata:
name: 'reproduce two authentication scheme exception'
description: |+
reproduce an exception thrown by the python taskcluster index client when calling
`taskclusterIndexClient.findArtifactFromTask(index, artifact)`
owner: [email protected]
source: 'https://gist.github.com/grenade/d681a022c0fc525f6147d1bad99e9f53'
import os
import taskcluster
proxiedIndexClient = taskcluster.Index({ 'rootUrl': os.environ['TASKCLUSTER_PROXY_URL'] })
try:
proxiedIndexClient.ping()
print('ping success using proxied {} {} client'.format(proxiedIndexClient.serviceName, proxiedIndexClient.apiVersion))
artifact = proxiedIndexClient.findArtifactFromTask('project.relops.cloud-image-builder.azure.win10-64.latest', 'public/image-bucket-resource.json')
print(artifact)
except Exception as e:
print(e)
directIndexClient = taskcluster.Index(taskcluster.optionsFromEnvironment())
try:
directIndexClient.ping()
print('ping success using direct {} {} client'.format(directIndexClient.serviceName, directIndexClient.apiVersion))
artifact = directIndexClient.findArtifactFromTask('project.relops.cloud-image-builder.azure.win10-64.latest', 'public/image-bucket-resource.json')
print(artifact)
except Exception as e:
print(e)
#!/bin/sh
apk update
apk add \
python3-dev \
gcc \
libc-dev \
util-linux
python -m pip install --upgrade pip | grep -v "^[[:space:]]*$"
pip install taskcluster==38.0.6 | grep -v "^[[:space:]]*$"
python --version
wget --quiet --output-document ./debug.py https://gist.githubusercontent.com/grenade/d681a022c0fc525f6147d1bad99e9f53/raw/debug.py?$(uuidgen)
python ./debug.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment