Attempts to upload the Docker image for a given tool to
        `DockerHub <https://hub.docker.com>`_.
44
def upload(self, tool: Tool) -> bool:
        
        return self.__installation.build.upload(tool.image)
565153
def upload(key, io, checksum: nil, **options)
      each_service.collect do |service|
        service.upload key, io.tap(&:rewind), checksum: checksum, **options
      end
    end
8080
def pull(self):
        
        for json_e in self.d.pull(repository=self.name, tag=self.tag, stream=True, decode=True):
            logger.debug(json_e)
            status = graceful_get(json_e, "status")
            if status:
                logger.info(status)
            else:
                error = graceful_get(json_e, "error")
                logger.error(status)
                raise ConuException("There was an error while pulling the image %s: %s",
                                    self.name, error)
        self.using_transport(SkopeoTransport.DOCKER_DAEMON)
1010573
def push(self, image_id, service_name, tag=None, namespace=None, url=None, username=None, password=None,
             repository_prefix=None, **kwargs):
        
        auth_config = {
            'username': username,
            'password': password
        }

        build_stamp = self.get_build_stamp_for_image(image_id)
        tag = tag or build_stamp

        if repository_prefix:
            image_name = "{}-{}".format(repository_prefix, service_name)
        elif repository_prefix is None:
            image_name = "{}-{}".format(self.project_name, service_name)
        elif repository_prefix == '':
            image_name = service_name
        repository = "{}/{}".format(namespace, image_name)

        if url != self.default_registry_url:
            url = REMOVE_HTTP.sub('', url)
            repository = "%s/%s" % (url.rstrip('/'), repository)

        logger.info('Tagging %s' % repository)
        self.client.api.tag(image_id, repository, tag=tag)

        logger.info('Pushing %s:%s...' % (repository, tag))
        stream = self.client.api.push(repository, tag=tag, stream=True, auth_config=auth_config)

        last_status = None
        for data in stream:
            data = data.splitlines()
            for line in data:
                line = json.loads(line)
                if type(line) is dict and 'error' in line:
                    plainLogger.error(line['error'])
                    raise exceptions.AnsibleContainerException(
                        "Failed to push image. {}".format(line['error'])
                    )
                elif type(line) is dict and 'status' in line:
                    if line['status'] != last_status:
                        plainLogger.info(line['status'])
                    last_status = line['status']
                else:
                    plainLogger.debug(line)
1129657
def upload(self):
        '''
        
        '''
        if not self.exists():
            self.create()

        data = self.stage().json()
        self.file_upload(data['post_url'], data)
        res = self.commit(data['dist_id'])
        data = res.json()
        return data
585905
def push(config, services):
    
    version = _get_version()
    for service_name, service_dict in services.iteritems():
        image = service_dict['image']
        things = {'image': image, 'version': version}
        _call_output('docker push {image}:latest'.format(**things))
        _call_output('docker push {image}:{version}'.format(**things))
527041
def upload(self, image, name=None):
        
        assert self.client_id, "imgur client ID is not set! Export the IMGUR_CLIENT_ID environment variable..."
        assert self.client_secret, "imgur client secret is not set! Export the IMGUR_CLIENT_SECRET environment variable..."

        # Prepare image
        try:
            image_data = (image + '')
        except (TypeError, ValueError):
            assert hasattr(image, "read"), "Image is neither a string nor an open file handle"
            image_type = "file"
            image_data = image  # XXX are streams supported? need a temp file?
            image_repr = repr(image)
        else:
            if image.startswith("http:") or image.startswith("https:"):
                image_type = "url"
                image_data = image
                image_repr = image
            elif all(ord(i) >= 32 for i in image) and os.path.exists(image):
                image_type = "file"
                image_data = image  # XXX open(image, "rb")
                image_repr = "file:" + image
            else:
                # XXX Not supported anymore (maybe use a temp file?)
                image_type = "base64"
                image_data = image_data.encode(image_type)
                image_repr = "<binary data>"

        # Upload image
        # XXX "name",    name or hashlib.md5(str(image)).hexdigest()),
        client = ImgurClient(self.client_id, self.client_secret)
        result = (client.upload_from_url if image_type == 'url'
                  else client.upload_from_path)(image_data)  # XXX config=None, anon=True)

        if result['link'].startswith('http:'):
            result['link'] = 'https:' + result['link'][5:]
        result['hash'] = result['id']  # compatibility to API v1
        result['caption'] = result['description']  # compatibility to API v1

        return parts.Bunch(
            image=parts.Bunch(result),
            links=parts.Bunch(
                delete_page=None,
                imgur_page=None,
                original=result['link'],
                large_thumbnail="{0}s.{1}".format(*result['link'].rsplit('.', 1)),
                small_square="{0}l.{1}".format(*result['link'].rsplit('.', 1)),
            ))
735038
def build_image(self, conf, pushing=False):
        """"""
        with conf.make_context() as context:
            try:
                stream = BuildProgressStream(conf.harpoon.silent_build)
                with self.remove_replaced_images(conf) as info:
                    cached = NormalBuilder().build(conf, context, stream)
                    info['cached'] = cached
            except (KeyboardInterrupt, Exception) as error:
                exc_info = sys.exc_info()
                if stream.current_container:
                    Runner().stage_build_intervention(conf, stream.current_container)

                if isinstance(error, KeyboardInterrupt):
                    raise UserQuit()
                else:
                    six.reraise(*exc_info)
            finally:
                if stream and stream.intermediate_images and conf.cleanup_intermediate_images:
                    for image in stream.intermediate_images:
                        log.info("Deleting intermediate image\timage=%s", image)
                        try:
                            conf.harpoon.docker_api.remove_image(image)
                        except Exception as error:
                            log.error("Failed to remove intermediate image\timage=%s\terror=%s", image, error)

        return cached
152058
def upload_image(vol, img, offset, parallel=1, 
  manual_shared_memory_id=None, manual_shared_memory_bbox=None, manual_shared_memory_order='F'):
  """"""
  global NON_ALIGNED_WRITE

  if not np.issubdtype(img.dtype, np.dtype(vol.dtype).type):
    raise ValueError('The uploaded image data type must match the volume data type. volume: {}, image: {}'.format(vol.dtype, img.dtype))

  (is_aligned, bounds, expanded) = check_grid_aligned(vol, img, offset)

  if is_aligned:
    upload_aligned(vol, img, offset, parallel=parallel, 
      manual_shared_memory_id=manual_shared_memory_id, manual_shared_memory_bbox=manual_shared_memory_bbox,
      manual_shared_memory_order=manual_shared_memory_order)
    return
  elif vol.non_aligned_writes == False:
    msg = NON_ALIGNED_WRITE.format(mip=vol.mip, chunk_size=vol.chunk_size, offset=vol.voxel_offset, got=bounds, check=expanded)
    raise AlignmentError(msg)

  # Upload the aligned core
  retracted = bounds.shrink_to_chunk_size(vol.underlying, vol.voxel_offset)
  core_bbox = retracted.clone() - bounds.minpt

  if not core_bbox.subvoxel():
    core_img = img[ core_bbox.to_slices() ] 
    upload_aligned(vol, core_img, retracted.minpt, parallel=parallel, 
      manual_shared_memory_id=manual_shared_memory_id, manual_shared_memory_bbox=manual_shared_memory_bbox,
      manual_shared_memory_order=manual_shared_memory_order)

  # Download the shell, paint, and upload
  all_chunks = set(chunknames(expanded, vol.bounds, vol.key, vol.underlying))
  core_chunks = set(chunknames(retracted, vol.bounds, vol.key, vol.underlying))
  shell_chunks = all_chunks.difference(core_chunks)

  def shade_and_upload(img3d, bbox):
    # decode is returning non-writable chunk
    # we're throwing them away so safe to write
    img3d.setflags(write=1) 
    shade(img3d, bbox, img, bounds)
    single_process_upload(vol, img3d, (( Vec(0,0,0), Vec(*img3d.shape[:3]), bbox.minpt, bbox.maxpt),), n_threads=0)

  download_multiple(vol, shell_chunks, fn=shade_and_upload)
509656
function pullImageIfMissing(docker, image, options) {
  debug('ensure image', image);
  var pullStream = new PullStatusStream();

  // first attempt to find the image locally...
  docker.getImage(image).inspect().then(
    function inspection(gotImg) {
      // push a value directly to the result without the transform.
      pullStream.push(image + ' exists in the cache.\r\n');
      // end the stream.
      pullStream.end();
    },

    function missingImage() {
      debug('image is missing pull', image);
      // image is missing so pull it
      return docker.pull(image, options || {}).then(function(rawPullStream) {
        rawPullStream.pipe(pullStream);
      });
    }
  ).then(
    null,
    function handleErrors(err) {
      pullStream.emit('error', err);
    }
  );

  return pullStream;
}
1005300
def upload(branch, user, tool):
    
    with ProgressBar(_("Uploading")):
        language = os.environ.get("LANGUAGE")
        commit_message = [_("automated commit by {}").format(tool)]

        # If LANGUAGE environment variable is set, we need to communicate
        # this to any remote tool via the commit message.
        if language:
            commit_message.append(f"[{language}]")

        commit_message = " ".join(commit_message)

        # Commit + push
        git = Git(Git.working_area)
        _run(git(f"commit -m {shlex.quote(commit_message)} --allow-empty"))
        _run(git.set(Git.cache)(f"push origin {branch}"))
        commit_hash = _run(git("rev-parse HEAD"))
        return user.name, commit_hash
1236496
async def import_image(self, data, stream: bool = False):
        
        headers = {"Content-Type": "application/x-tar"}
        response = await self.docker._query_chunked_post(
            "images/load", "POST", data=data, headers=headers
        )
        return await json_stream_result(response, stream=stream)
418004
def docker_call(tool, tool_parameters, work_dir, java_opts=None, outfile=None,
                dockerhub='aarjunrao', interactive=False):
    
    # If an outifle has been provided, then ensure that it is of type file, it is writeable, and
    # that it is open.
    if outfile:
        assert isinstance(outfile, file), 'outfile was not passsed a file'
        assert outfile.mode in ['w', 'a', 'wb', 'ab'], 'outfile not writeable'
        assert not outfile.closed, 'outfile is closed'
    # If the call is interactive, set intereactive to -i
    if interactive:
        interactive = '-i'
    else:
        interactive = ''
    # If a tag is passed along with the image, use it.
    if ':' in tool:
        docker_tool = '/'.join([dockerhub, tool])
    # Else use 'latest'
    else:
        docker_tool = ''.join([dockerhub, '/', tool, ':latest'])
    # Get the docker image on the worker if needed
    call = ['docker', 'images']
    dimg_rv = subprocess.check_output(call)
    existing_images = [':'.join(x.split()[0:2]) for x in dimg_rv.splitlines()
                       if x.startswith(dockerhub)]
    if docker_tool not in existing_images:
        try:
            call = ' '.join(['docker', 'pull', docker_tool]).split()
            subprocess.check_call(call)
        except subprocess.CalledProcessError as err:
            raise RuntimeError('docker command returned a non-zero exit status ' +
                               '(%s)' % err.returncode + 'for command \"%s\"' % ' '.join(call),)
        except OSError:
            raise RuntimeError('docker not found on system. Install on all' +
                               ' nodes.')
    # If java options have been provided, it needs to be in the docker call
    if java_opts:
        base_docker_call = ' docker run -e JAVA_OPTS=-Xmx{} '.format(java_opts) + '--rm=true ' + \
            '-v {}:/data --log-driver=none '.format(work_dir) + interactive
    else:
        base_docker_call = ' docker run --rm=true -v {}:/data '.format(work_dir) + \
            '--log-driver=none ' + interactive
    call = base_docker_call.split() + [docker_tool] + tool_parameters
    try:
        subprocess.check_call(call, stdout=outfile)
    except subprocess.CalledProcessError as err:
        raise RuntimeError('docker command returned a non-zero exit status (%s)' % err.returncode +
                           'for command \"%s\"' % ' '.join(call),)
    except OSError:
        raise RuntimeError('docker not found on system. Install on all nodes.')
84811
def upload_site(self):
        """"""
        if not os.path.isdir(self._config['build_dir']):
            message = 'Site not built at {0}'.format(self._config['build_dir'])
            self._logger.error(message)
            raise RuntimeError(message)

        ltdclient.upload(self._config)
7211
def upload(self, *args, **kwargs):
    """"""
    for job in self.jobs:
      job.upload(*args, **kwargs)
102380
def upload():
    """"""
    try:
        o = check_output(['twine', 'upload'] + glob('dist/*'))
    except CalledProcessError:
        call(['twine', 'upload'] + glob('dist/*'))
        raise
    print(o.decode('utf-8'))
1153324
def upload_from_url(self, url, **kwds):
        
        result = self._client.post("/photo/upload.json", photo=url,
                                   **kwds)["result"]
        return Photo(self._client, result)