MCPcopy Create free account
hub / github.com/apache/arrow / push

Method push

dev/archery/archery/docker/core.py:428–456  ·  view source on GitHub ↗
(self, service_name, user=None, password=None)

Source from the content-addressed store, hash-verified

426 self._execute_compose('run', '--rm', *args)
427
428 def push(self, service_name, user=None, password=None):
429 def _push(service):
430 args = ['push'] + self.config.verbosity_args()
431 if self.config.using_docker:
432 return self._execute_docker(*args, service['image'])
433 else:
434 return self._execute_compose(*args, service['name'])
435
436 service = self.config.get(service_name)
437
438 if user is not None:
439 login_args = ['--username', user, '--password-stdin']
440 login_kwargs = {'input': password.encode()}
441 image = service['image']
442 # [[HOST[:PORT]/]NAMESPACE/]REPOSITORY[:TAG]
443 components = image.split('/', 3)
444 if len(components) == 3:
445 server = components[0]
446 login_args.append(server)
447 try:
448 self._execute_docker('login', *login_args, **login_kwargs)
449 except subprocess.CalledProcessError:
450 # hide credentials
451 msg = f'Failed to push `{service_name}`, check the passed credentials'
452 raise RuntimeError(msg) from None
453
454 for ancestor in service['ancestors']:
455 _push(self.config.get(ancestor))
456 _push(service)
457
458 def images(self):
459 return sorted(self.config.hierarchy.keys())

Callers 3

test_compose_pushFunction · 0.95
docker_compose_pushFunction · 0.45

Calls 5

_execute_dockerMethod · 0.95
lenFunction · 0.85
getMethod · 0.45
encodeMethod · 0.45
appendMethod · 0.45

Tested by 2

test_compose_pushFunction · 0.76