首页 > 其他分享 >语言模型(马尔可夫模型,n元语法)

语言模型(马尔可夫模型,n元语法)

时间:2022-12-15 13:23:49浏览次数:65  
标签:access container runner 模型 语法 马尔可夫 entrypoint Docker image

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.

标签:access,container,runner,模型,语法,马尔可夫,entrypoint,Docker,image
From: https://www.cnblogs.com/sdfasdf/p/16984767.html

相关文章

  • JVM的内存区域划分(面试问题:你了解java内存模型么)
    学过C语言的朋友都知道C编译器在划分内存区域的时候经常将管理的区域划分为数据段和代码段,数据段包括堆、栈以及静态数据区。那么在Java语言当中,内存又是如何划分的呢?......
  • java内存模型
    一.内存模型的相关概念。大家都知道,计算机在执行程序时,每条指令都是在CPU中执行的,而执行指令过程中,势必涉及到数据的读取和写入。由于程序运行过程中的临时数据是存放在......
  • tensorflow 模型保存格式
    tensorflow模型保存格式https://www.cnblogs.com/wioponsen/p/13524037.htmlhttps://blog.csdn.net/qq_42738654/article/details/121096614https://www.zdaiot.com/ML......
  • 前端开发系列057-网络篇之PHP基础语法
    title:'前端开发系列057-网络篇之PHP基础语法'tags:categories:[]date:2018-01-2217:07:55一、PHP简单介绍PHP和它的应用领域简单介绍PHP(全称:PHP:HypertextPre......
  • django模型层详解
    django模型层详解自带的sqlate3数据库对时间字段不敏感有时候会展示错乱所以我们习惯切换成常见的数据库比如MYSQLdjangoorm并不会帮我们创建数据库所以需要我们自己......
  • Django框架:6、模型层之ORM查询关键字、SQL语句转换
    Django框架之模型层一、模型层前期准备介绍​ 在django框架中,模型层是直接和数据库进行操作的,所有数据的增删改查都由模型层来完成​ django框架自带的sqlite3数据库......
  • Django之模型层
    模型层之前期准备自带的sqlite3数据库对时间字段不敏感,有时候会展示错乱,所以我们习惯切换成常见的数据库比如MySQL,djangoorm并不会自动帮你创建库,所以需要提前准备好。D......
  • python3.7.3基础语法
     1.注释1#单行注释这是单行注释2'''多行注释'''这是多行注释3"""多行注释"""这是多行注释 2.标识符 我们......
  • django之模型层
    目录模型层模型层前期准备模型层之ORM常见关键字模型层模型层前期准备使用djangoORM要注意​ 1、django自带的sqlite3数据可对时间字段不敏感,有时候会展示错乱,所以我......
  • django 5 模板层补充与模型层基础
    今日内容详细目录今日内容详细模板层之标签自定义过滤器、标签及inclusion_tag(了解)模板的继承与导入模型层模型层之前期准备ORM常用关键字模板层之标签{%if条件1(可......