首页 > 其他分享 >【AI with ML】第 10 章 :创建 ML 模型以预测序列

【AI with ML】第 10 章 :创建 ML 模型以预测序列

时间:2022-12-21 20:46:52浏览次数:60  
标签:10 container AI ML image access runner 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.

标签:10,container,AI,ML,image,access,runner,entrypoint,Docker
From: https://www.cnblogs.com/sdfasdf/p/16997198.html

相关文章

  • [LeetCode]010-正则表达式匹配
    >>>传送门题目给你一个字符串 s 和一个字符规律 p,请你来实现一个支持'.' 和 '*' 的正则表达式匹配。'.'匹配任意单个字符'*'匹配零个或多个前面的那一个元......
  • Django10
    forms组件渲染标签<p>forms组件渲染标签的方式1(封装程度过高扩展性差主要用于本地测试):</p>{{form_obj.as_p}}{{form_obj.as_ul}}{{form_obj.as_table}}......
  • 代码大全10-2
      第一部分是打好基础,本部分主要是软件构建前期的工作,以及对一些基本概念的介绍,具体包括如何选择编程语言和构建实践方法,如何理解软件开发的过程。软件开发本质上说就是......
  • 基于Linux Kernel 4.8的Ubuntu 16.10 即将发布
    今天早些时候,我们惊讶的发现Ubuntu16.10(YakketyYak)已经基于Linux Kernel4.8分支了,Linux4.8分支目前还在研发状态,最终版本将于今年10月2日正式上线。此前Ubuntu16.10......
  • 简单易用的监控告警 | HertzBeat 在 Rainbond 上的使用分享
    在现有的监控告警体系中Prometheus+AlertManger+Grafana一直是主流,但对于中小团队或个人来说,这种体系显的较为复杂。而HertzBeat能让中小团队或个人很快速的搭建监......
  • ChatGpt OpenAI注册步骤(超详细!!)
    最近,很火的OpenAI ChatGPT,大伙都跃跃欲试。  由于注册过程比较麻烦,我整理了一下注册步骤。一、前期准备:1、梯子(需要国外代理)2、国外接码平台,推荐sms-a......
  • 带你玩转OpenHarmony AI:基于Seetaface2的人脸识别
     简介随着时代的进步,全民刷脸已经成为一种新型的生活方式,这也是全球科技进步的又一阶梯,人脸识别技术已经成为一种大趋势,无论在智慧出行、智能家居、智慧办公等场景均......
  • 在1-100中 打印3的倍数
    关键在于:i%3==0,保证被三整除就可以了#include<stdio.h>intmain(){inti;for(i=1;i<101;i++){if(i%3==0)printf("%d",i);}return0;}......
  • MEGAN V2.10 的pgf90编译器安装以及相关问题解决
    这里列出了一些MEGAN安装中可能遇到的一些问题,分享出我自己的一些解决方法。pgf90编译器的下载:目前PGI已经被整合到NVIDA官方cuda,所以只能直接下载整个到linux中:https:/......
  • 虹科方案|将以太网连接添加到Dell EMC PowerVault™ ML3 SAS库
    一、DellEMC和 ATTO磁带解决方案DellEMC和 ATTO提供了业界唯一的商用解决方案,可将高速以太网连接添加到标准SASLTO磁带驱动器。ATTOXstreamCORE®ET8200智......