首页 > 其他分享 >selenium三大等待

selenium三大等待

时间:2022-12-20 22:00:43浏览次数:63  
标签:container runner image selenium access entrypoint Docker 等待 三大

Override the entrypoint of an image

Introduced in GitLab and GitLab Runner 9.4. Read more about the extended configuration options.

Before explaining the available entrypoint override methods, let’s describe how the runner starts. It uses a Docker image for the containers used in the CI/CD jobs:

  1. The runner starts a Docker container using the defined entrypoint. The default from Dockerfile that may be overridden in the .gitlab-ci.yml file.
  2. The runner attaches itself to a running container.
  3. The runner prepares a script (the combination of before_scriptscript, and after_script).
  4. The runner sends the script to the container’s shell stdin and receives the output.

To override the entrypoint of a Docker image, define an empty entrypoint in the .gitlab-ci.yml file, so the runner does not start a useless shell layer. However, that does not work for all Docker versions.

  • For Docker 17.06 and later, the entrypoint can be set to an empty value.
  • For Docker 17.03 and earlier, the entrypoint can be set to /bin/sh -c/bin/bash -c, or an equivalent shell available in the image.

The syntax of image:entrypoint is similar to Dockerfile’s ENTRYPOINT.

Let’s assume you have a super/sql:experimental image with a SQL database in it. You want to use it as a base image for your job because you want to execute some tests with this database binary. Let’s also assume that this image is configured with /usr/bin/super-sql run as an entrypoint. When the container starts without additional options, it runs the database’s process. The runner expects that the image has no entrypoint or that the entrypoint is prepared to start a shell command.

With the extended Docker configuration options, instead of:

  • Creating your own image based on super/sql:experimental.
  • Setting the ENTRYPOINT to a shell.
  • Using the new image in your CI job.

You can now define an entrypoint in the .gitlab-ci.yml file.

For Docker 17.06 and later:

image:
  name: super/sql:experimental
  entrypoint: [""]

For Docker 17.03 and earlier:

image:
  name: super/sql:experimental
  entrypoint: ["/bin/sh", "-c"]

Define image and services in config.toml

Look for the [runners.docker] section:

[runners.docker]
  image = "ruby:latest"
  services = ["mysql:latest", "postgres:latest"]

The image and services defined this way are added to all jobs run by that runner.

Access an image from a private Container Registry

To access private container registries, the GitLab Runner process can use:

To define which option should be used, the runner process reads the configuration in this order:

  • DOCKER_AUTH_CONFIG CI/CD variable.
  • DOCKER_AUTH_CONFIG environment variable set in the runner’s config.toml file.
  • config.json file in $HOME/.docker directory of the user running the process. If the --user flag is provided to run the child processes as unprivileged user, the home directory of the main runner process user is used.

Requirements and limitations

  • Available for Kubernetes executor in GitLab Runner 13.1 and later.
  • Credentials Store and Credential Helpers require binaries to be added to the GitLab Runner $PATH, and require access to do so. Therefore, these features are not available on shared runners, or any other runner where the user does not have access to the environment where the runner is installed.

Use statically-defined credentials

There are two approaches that you can take to access a private registry. Both require setting the CI/CD variable DOCKER_AUTH_CONFIG with appropriate authentication information.

  1. Per-job: To configure one job to access a private registry, add DOCKER_AUTH_CONFIG as a CI/CD variable.
  2. Per-runner: To configure a runner so all its jobs can access a private registry, add DOCKER_AUTH_CONFIG as an environment variable in the runner’s configuration.

标签:container,runner,image,selenium,access,entrypoint,Docker,等待,三大
From: https://www.cnblogs.com/sdfasdf/p/16995202.html

相关文章

  • python + selenium实现gitlab全文搜索
    一般来说软件开发相关企业都会有自己内部的源代码管理工具,比如私有部署的gitlab服务器。特别是企业上规模之后会有多个产品线,各个业务产品线各自的项目解决方案会非常多。......
  • 利用PreLoader实现一个平视显示(HUD)效果(可以运用到加载等待效果),并进行简单的讲解
    什么是PreLoader?PreLoader是由​​VolodymyrKurbatov​​设计的一个很有意思的HUD(平视显示效果(HeadUpDisplay)),通过运动污点和固定污点之间的粘黏动画吸引用户的眼球跟踪,能......
  • 综合方法selenium整理
    1.1  下载selenium2.0的包官方download包地址:​​http://code.google.com/p/selenium/downloads/list​​官方UserGuide: ​​http://seleniumhq.org/docs/​​官......
  • pyppeteer:比 selenium 更高效的爬虫利器
     API接口文档:APIReference:​​https://miyakogi.github.io/pyppeteer/reference.html​​pyppeteer github地址:​​https://github.com/miyakogi/pyppeteer​​pyppete......
  • puppeteer( Nodejs 版 selenium )快速入门
    puppeteer官网:​​https://pptr.dev/​​Puppeteer中文文档(与官Puppeteer中文文档 :​​https://learnku.com/docs/puppeteer/3.1.0​​Puppeteerv1.5.0中文翻peteer......
  • 故障分析 | 有效解决 MySQL 行锁等待超时问题【建议收藏】
    作者:xuty本文来源:原创投稿*爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。一、背景####2019121910:10:10,234|com.alibaba.druid.filter......
  • Selenium2.0中文在线文档项目,求翻译达人
    前一阵子在学习selenium2.0,发现网上很多资料都是selenium1.0的且部分信息不准确,无奈只能去官方看英文文档。费劲巴拉的看完了后,就有想法把selenium2.0的文档进行中文翻译,并......
  • 【Selenium :3种等待方式详解】
    应用场景自动化打开一个网页的时候,内部网页元素加载完全有一点的延迟性,因此在做Web端的自动化测试的时候,一般都需要在测试case时加入一些等待操作。我们常用等待操作有......
  • MySQL锁等待超时一例分析
    1、问题现象开发反馈某业务持续性报锁等待超时,相关错误信息如下:Lock wait timeout exceeded; try restarting transaction为了能精确定位问题,继续询问开发有没有......
  • 【Selenium : 文件操作】
    一、前言文件操作是Web端自动化中比较常用的一个操作,一般文件操作包含:上传、下载WebDriver仅仅提供了下载文件相关的API,上传文件的API并没实现,需要我们自己去实现;而且......