Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Use docker cli instead of Docker Hub v1 API
Browse files Browse the repository at this point in the history
Docker Hub v1 API has been removed. See https://www.docker.com/blog/docker-hub-v1-api-deprecation/
  • Loading branch information
Atry committed Sep 9, 2022
1 parent d332ae2 commit ce6fae4
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions aws/hhvm1/lambdas/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from urllib import request

import common

import subprocess

class Activity:
# Subclasses must override these.
Expand Down Expand Up @@ -228,20 +228,18 @@ class PublishDockerImages(Activity):
def task_env(self):
return {'DOCKER_ONLY': '1'}

def docker_tags(self, repo):
return {
tag['name'] for tag in json.loads(
request
.urlopen(f'https://index.docker.io/v1/repositories/hhvm/{repo}/tags')
.read()
.decode('ascii')
)
}
def is_docker_tag_absent(self, repo):
docker_subprocess = subprocess.run(('docker', 'manifest', 'inspect', f'hhvm/hhvm:{self.version()}'), capture_output=True)
if docker_subprocess.returncode == 1 and process.stderr.startswith(b'no such manifest'):
return True
else:
docker_subprocess.check_returncode()
return False

def should_run(self):
return (
self.version() not in self.docker_tags('hhvm') or
self.version() not in self.docker_tags('hhvm-proxygen')
self.is_docker_tag_absent('hhvm') or
self.is_docker_tag_absent('hhvm-proxygen')
)


Expand Down

0 comments on commit ce6fae4

Please sign in to comment.