Skip to content

Instantly share code, notes, and snippets.

@teutat3s
Created February 3, 2020 22:43
Show Gist options
  • Save teutat3s/c57e3032d33790c11afb36ee61611fe3 to your computer and use it in GitHub Desktop.
Save teutat3s/c57e3032d33790c11afb36ee61611fe3 to your computer and use it in GitHub Desktop.
{
"execution": "failed",
"chain_results": [
{
"result": "",
"error": {
"name": "ResourceNotFound",
"message": "UnauthorizedError"
},
"name": "pull_image_v2_layers",
"started_at": "2020-02-03T22:36:10.884Z",
"finished_at": "2020-02-03T22:36:11.149Z"
}
],
"params": {
"task": "pull-image-v2",
"rat": {
"index": {
"name": "hub.example.com",
"official": false
},
"official": false,
"remoteName": "my-alpine",
"localName": "hub.example.com/my-alpine",
"canonicalName": "hub.example.com/my-alpine",
"tag": "latest"
},
"req_id": "422fa4b2-3c20-4a8e-b761-adbcb1f3c47d",
"account_uuid": "aab0f485-69e7-467f-a86e-9b4d4a4875ad",
"regAuth": "REDACTED"
},
"task": "pull-image-v2",
"target": "/pull-image-v2-hub.example.com/my-alpine",
"workflow": "bd9b7576-9b43-452e-8079-ed7d646d82f3",
"exec_after": null,
"num_attempts": 0,
"name": "pull-image-v2-1.0.0",
"version": "1.0.0",
"timeout": 3620,
"workflow_uuid": "bd9b7576-9b43-452e-8079-ed7d646d82f3",
"created_at": "2020-02-03T22:36:09.660Z",
"onerror_results": [
{
"result": "",
"error": "Error executing job",
"name": "On error",
"started_at": "2020-02-03T22:36:11.303Z",
"finished_at": "2020-02-03T22:36:11.342Z"
}
],
"started": 1580769370884,
"elapsed": 0.619,
"uuid": "fc58db03-abe8-4e6e-b983-19bef61fe4cf",
"chain": [
{
"name": "pull_image_v2_layers",
"timeout": 3600,
"retry": 1,
"body": "function pullImageLayersV2(job, cb) {\n var queue = vasync.queue(processMessage, 5);\n var queueError;\n\n // For now assume dockerUrl is the URL to the DOCKER_HOST. In this case\n // we parse the URL to obtain the location of the admin host\n var parsedUrl = urlModule.parse(dockerUrl);\n var dockerAdminiUrl = parsedUrl.protocol + '//' + parsedUrl.hostname;\n var dockerAdmin = restify.createJsonClient({\n url: dockerAdminiUrl,\n headers: { 'x-request-id': job.params.req_id }\n });\n var imageCreated = false;\n var imgapi = new sdcClients.IMGAPI({url: imgapiUrl});\n\n function processMessage(data, next) {\n if (data.type == 'error') {\n /*\n * Currently WFAPI will add `err.message` and `err.name` to the\n * chain_results. We'll slip our error *code* in using `err.name`.\n */\n queueError = new Error(data.error.message);\n if (data.error.code) {\n queueError.name = data.error.code;\n }\n next();\n } else if (data.type === 'create-docker-image') {\n createDockerImage(data, next);\n } else {\n // type 'progress' or 'status'\n if (data.type == 'progress'\n && data.payload && !data.payload.progressDetail) {\n data.payload.progressDetail = {};\n }\n dockerAdmin.post('/admin/progress', data, next);\n }\n }\n\n function createDockerImage(data, next) {\n assert.string(data.config_digest, 'data.config_digest');\n\n job.log.info('createDockerImage:: data: %s', JSON.stringify(data));\n\n var query = {\n owner_uuid: job.params.account_uuid,\n config_digest: data.config_digest\n };\n // Remeber the digest for tagging.\n job.params.config_digest = data.config_digest;\n\n dockerAdmin.get({\n path: '/admin/images_v2',\n query: query\n }, function (err, req, res, images) {\n if (err) {\n next(err);\n return;\n }\n\n if (images && images.length > 0) {\n // Image with this digest already exists - no need to update, if\n // they have the same digest then they have the same content.\n job.log.debug({config_digest: data.config_digest},\n 'createDockerImage:: image already exists');\n imageCreated = true;\n next();\n return;\n }\n\n var path = '/admin/images_v2?action=create';\n data.owner_uuid = job.params.account_uuid;\n dockerAdmin.post(path, data, function (adminErr) {\n if (adminErr) {\n queueError = adminErr;\n job.log.error({config_digest: data.config_digest},\n 'createDockerImage:: error: %s', adminErr);\n } else {\n imageCreated = true;\n job.log.debug({config_digest: data.config_digest},\n 'createDockerImage:: image created');\n }\n next(err);\n });\n });\n }\n\n var opts = {\n repo: job.params.rat.canonicalName,\n tag: job.params.rat.tag,\n digest: job.params.rat.digest,\n regAuth: job.params.regAuth,\n regConfig: job.params.regConfig,\n /*\n * All sdc-docker pull images are owned by and private to 'admin'.\n * It is sdc-docker code that gates access to all the images.\n */\n public: false,\n headers: { 'x-request-id': job.params.req_id }\n };\n\n imgapi.adminImportDockerImage(opts, function (connectErr, res) {\n if (connectErr) {\n job.log.info('adminImportDockerImage error %s', connectErr);\n cb(connectErr);\n return;\n }\n\n var lstream = new LineStream({ encoding: 'utf8' });\n\n lstream.on('error', function (lerr) {\n job.log.info('LineStream threw an error %s', lerr);\n cb(lerr);\n });\n\n lstream.on('readable', function () {\n var line;\n while ((line = lstream.read()) !== null) {\n queue.push(JSON.parse(line));\n }\n });\n\n res.on('end', function onEnd() {\n queue.close();\n\n // Wait for queue to finish before ending the task\n queue.on('end', function () {\n if (queueError) {\n cb(queueError);\n } else if (!imageCreated) {\n // If there was no error, yet there was no image created,\n // then there must have been a timeout (i.e. connection was\n // closed abruptly), so fire the callback with an error.\n cb(new Error('pullImageLayers failed - '\n + 'no successful create-docker-image'));\n } else {\n cb(null, 'pullImageLayers completed');\n }\n });\n });\n\n res.pipe(lstream);\n });\n}",
"modules": {
"assert": "assert-plus",
"LineStream": "lstream",
"restify": "restify",
"sdcClients": "sdc-clients",
"urlModule": "url",
"vasync": "vasync"
}
},
{
"name": "tag_image_v2",
"timeout": 20,
"retry": 1,
"body": "function tagImageV2(job, cb) {\n if (!job.params.rat.tag) {\n cb(null, 'No tag for head image');\n return;\n }\n\n var parsedUrl = urlModule.parse(dockerUrl);\n var dockerAdminUrl = parsedUrl.protocol + '//' + parsedUrl.hostname;\n var dockerAdmin = restify.createJsonClient({\n url: dockerAdminUrl,\n headers: { 'x-request-id': job.params.req_id }\n });\n\n var data = {\n owner_uuid: job.params.account_uuid,\n repo: job.params.rat.localName,\n tag: job.params.rat.tag,\n config_digest: job.params.config_digest\n };\n\n dockerAdmin.post('/admin/image_tags_v2', data, function (createErr) {\n if (createErr) {\n cb(createErr);\n return;\n }\n\n cb(null, 'Head image has been tagged');\n });\n}",
"modules": {
"restify": "restify",
"urlModule": "url"
}
}
],
"onerror": [
{
"name": "On error",
"modules": {},
"body": "function (job, cb) {\n return cb('Error executing job');\n }"
}
]
}
docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
WARNING: compose.config.environment.__getitem__: The TRITON_ACCOUNT variable is not set. Defaulting to a blank string.
WARNING: compose.config.environment.__getitem__: The TRITON_DC variable is not set. Defaulting to a blank string.
docker.utils.config.find_config_file: Trying paths: ['/Users/devop/.docker/config.json', '/Users/devop/.dockercfg']
docker.utils.config.find_config_file: Found file at path: /Users/devop/.docker/config.json
docker.auth.load_config: Found 'auths' section
docker.auth.parse_auth: Auth data for hub.example.com is absent. Client might be using a credentials store instead.
docker.auth.load_config: Found 'credsStore' section
urllib3.connectionpool._new_conn: Starting new HTTPS connection (1): docker.example.com:2376
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/version HTTP/1.1" 200 149
compose.cli.command.get_client: docker-compose version 1.25.2, build 698e2846
docker-py version: 4.1.0
CPython version: 3.7.5
OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019
compose.cli.command.get_client: Docker base_url: https://docker.example.com:2376
compose.cli.command.get_client: Docker version: ApiVersion=1.21, Arch=i386, BuildTime=2020-01-03T00:24:33Z, GitCommit=3faf7f9, GoVersion=node4.9.0, Os=solaris, Version=1.9.0
compose.cli.verbose_proxy.proxy_callable: docker info <- ()
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/info HTTP/1.1" 200 423
compose.cli.verbose_proxy.proxy_callable: docker info -> {'Architecture': 'x86_64',
'Containers': 18,
'Driver': 'sdc',
'DriverStatus': [['SDCAccount', 'devop']],
'ExecutionDriver': 'sdc-0.5.9',
'ID': '88e4c263-658f-4b02-a698-d5637a256f81',
'IPv4Forwarding': True,
'Images': 0,
'IndexServerAddress': 'https://index.docker.io/v1/',
'KernelVersion': '3.12.0-1-amd64',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=vault', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dvault%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 2
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=vault', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dvault%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 2
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=vault', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dvault%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 2
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=vault', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dvault%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 2
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=vault', 'com.docker.compose.service=vault', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dvault%22%2C+%22com.docker.compose.service%3Dvault%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 2
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=vault', 'com.docker.compose.service=vault', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dvault%22%2C+%22com.docker.compose.service%3Dvault%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 2
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('hub.example.com/my-alpine:latest')
urllib3.connectionpool._make_request: https://docker.example.com:2376 "GET /v1.21/images/hub.example.com/my-alpine:latest/json HTTP/1.1" 404 109
compose.service.pull: Pulling vault (hub.example.com/my-alpine:latest)...
compose.cli.verbose_proxy.proxy_callable: docker pull <- ('hub.example.com/my-alpine', tag='latest', stream=True, platform=None)
docker.auth.get_config_header: Looking for auth config
docker.auth.resolve_authconfig: Using credentials store "osxkeychain"
docker.auth._resolve_authconfig_credstore: Looking for auth entry for 'hub.example.com'
docker.auth.get_config_header: Found auth config
urllib3.connectionpool._make_request: https://docker.example.com:2376 "POST /v1.21/images/create?tag=latest&fromImage=hub.example.com%2Fmy-alpine HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker pull -> <generator object APIClient._stream_helper at 0x10ecffb50>
ERROR: compose.cli.main.main: Error: image hub.example.com/my-alpine:latest not found (a186d784-305a-4b0a-aeae-3f4633dc6687)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment