首页 > 其他分享 >ChatGPT教程之 05 ChatGPT 和你的工作

ChatGPT教程之 05 ChatGPT 和你的工作

时间:2022-12-12 17:12:21浏览次数:94  
标签:教程 05 runner image access process entrypoint ChatGPT 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.

标签:教程,05,runner,image,access,process,entrypoint,ChatGPT,Docker
From: https://www.cnblogs.com/sdfasdf/p/16976564.html

相关文章

  • MLK-CZ05-7015-485 ZYNQ 核心模块硬件手册
    用户须知—使用必看 核心板使用人员:您好!感谢您使用我公司产品,为避免在开发过程中遇到问题,请您在使用前阅读以下几点内容。 1、硬件手册对开发板参数说明来源于开发......
  • webstorm | Outdated | IDEA License Server Detected过期的问题(自己搭建认证服务器的
    自己搭建认证服务器的教程这里我只是个搬运工,归档员。方法一、具体的参加链接:​​http://idea.lanyus.com/​​自己根据上面的链接地址,可以自行构建自己的LicenseServer。......
  • Eclipse安装和配置环境教程(图文详解)
    前言在上一篇文章中,壹哥给大家介绍了Notepad++这个更高级点的记事本,它进行Java开发相比windows自带的记事本要更方便一些。但是即便如此,用这种记事本进行Java开发效率依然......
  • 米联客MLK-F6-CZ05-7015 开发平台硬件手册
    用户须知—使用必看 核心板使用人员:您好!感谢您使用我公司产品,为避免在开发过程中遇到问题,请您在使用前阅读以下几点内容。 1、硬件手册对开发板参数说明来源于开发......
  • 传奇GOM引擎微端架设教程
    传奇GOM引擎微端架设教程​GOM引擎架设微端需要准备好微端程序,用网站下载在服务器的版本​(注:本文章图有打码处因平台GZ原因需打码望读者理解)​Mirserver文件一般都是自带微......
  • 我为 OpenAI ChatGPT 生态处理一个致命 BUG 的经过
    最近的ChatGPT应该不用我多说了,不过避免有朋友还没收到相关推送,我还是简单介绍两句:了解ChatGPTChatGPT是OpenAI的一个产物,是继GPT-3.5系列的主力模型之一,这一模......
  • 人工智能聊天机器人chatGPT(不需注册和富强直接体验)
    最近ChatGPT实在太火了。在经历一轮接一轮推荐之后,我也研究了一下。ChatGPT是美国人工智能公司OpenAI发布智能聊天机器人,可以查询信息、撰写文章、编写代码等,被称作最强人......
  • 【题解】P2050 [NOI2012] 美食节
    [NOI2012]美食节题目描述CZ市为了欢迎全国各地的同学,特地举办了一场盛大的美食节。作为一个喜欢尝鲜的美食客,小M自然不愿意错过这场盛宴。他很快就尝遍了美食节所有......
  • CAD图如何转换成PDF?CAD导出PDF教程
    CAD图纸设计完成后,通常会需要将其转换成PDF格式进行流转。那么,你知道CAD图如何转换成PDF吗?本文小编就以浩辰CAD软件为例给大家分享无需安装任何插件,一键将CAD导出PDF格式。......
  • 微信公众号服务号配置对接在线客服系统教程
    如果只需要实现微信公众号的关注自动回复,关键词自动回复功能,普通订阅号就可以当需要对接实现公众号的模板消息提醒,模板消息与客服端H5的对接,访客在微信点击或扫码时获取到......