Commit ceab383b authored by Steve Grossman's avatar Steve Grossman 💬

merging latest master into 3793-docs-feedback-run-runner-on-kubernetesj

parents 31748abf 6659cb30
Pipeline #48095777 passed with stages
in 30 minutes and 11 seconds
v11.8.0-rc1 (2019-02-11)
- Kubernetes executor: add support for Node tolerations !941
- Update logrus version to v1.3.0 !1137
- Docs - Clarify Docker Runner Documentation !1097
- Update github.com/stretchr/testify dependency !1141
- Update LICENSE file !1132
- Update example of cache config !1140
- Update documentation for autoscaling on AWS !1142
- Remove unnecessary dep constraint !1147
- readme: make author block render md !999
- Corrected note when using a config container to mount custom data volume. !1126
- Fix typo in documentation of k8s executor. !1118
- Make new runner tokens compatible with docker-machine executor !1144
- docs: Use `sudo tee` for apt pinning. !1047
- docs: fix indendation !1081
- Updated hint on running Windows 10 shell as administrator !1136
- Fixed typo in logged information !1074
- Update registry_and_cache_servers.md !1098
- Update golang.org/x/sys !1149
- Refactor frontpage for grammar and style !1151
- Update github.com/Azure/go-ansiterm dependency !1152
- Testing on windows with vagrant !1003
- Add fix for race condition in windows cache extraction !863
- Consolidate docker API version definition !1154
- Prevent Executors from modifying Runner configuration !1134
- Update ExecutorProvider interface signature !1159
- Update logging for processing multi runner !1160
- Update kubernetes.md - fix typo for bearer_token !1162
- Update github.com/prometheus/client_golang dep !1150
- Remove ContainerWait from docker client !1155
- Update advanced-configuration.md: Fix blockquote not reaching the entire note !1163
- Fix docs review app URL !1169
- docs: Add a helpful command to reload config !1106
- Update AWS autoscale documentation !1166
- Refactor dockerfiles !1068
- Add link to AWS driver about default values !1171
- Add support for fedora/29 packages !1082
- Add windows server 2019 as default for windows development !1165
- Docs: Fix bad anchor links in runner docs !1177
- Improve documentation concerning proxy setting in the case of docker-in-docker-executor !1090
- Add few fixes to Release Checklist template !1135
- Set table to not display under TOC !1168
- Update Docker client SDK !1148
- docs: add GitLab Runner Helm Chart link !945
v11.7.0 (2019-01-22)
- Docs: Cleaning up the executors doc !1114
- Update to testify v1.2.2 !1119
......
11.8.0
\ No newline at end of file
11.9.0
\ No newline at end of file
......@@ -630,7 +630,7 @@ func (mr *RunCommand) handleShutdown() error {
return fmt.Errorf("forced exit: %v", mr.stopSignal)
case <-time.After(common.ShutdownTimeout * time.Second):
return errors.New("shutdown timedout")
return errors.New("shutdown timed out")
case <-mr.runFinished:
// Everything finished we can exit now
......
......@@ -54,7 +54,7 @@ func waitForInterrupts(finished *abool.AtomicBool, abortSignal chan os.Signal, d
case newSignal := <-interruptSignals:
log.Fatalln("forced exit:", newSignal)
case <-time.After(common.ShutdownTimeout * time.Second):
log.Fatalln("shutdown timedout")
log.Fatalln("shutdown timed out")
case <-doneSignal:
}
}
......
......@@ -73,7 +73,7 @@ type DockerConfig struct {
SecurityOpt []string `toml:"security_opt" json:"security_opt" long:"security-opt" env:"DOCKER_SECURITY_OPT" description:"Security Options"`
Devices []string `toml:"devices" json:"devices" long:"devices" env:"DOCKER_DEVICES" description:"Add a host device to the container"`
DisableCache bool `toml:"disable_cache,omitzero" json:"disable_cache" long:"disable-cache" env:"DOCKER_DISABLE_CACHE" description:"Disable all container caching"`
Volumes []string `toml:"volumes,omitempty" json:"volumes" long:"volumes" env:"DOCKER_VOLUMES" description:"Bind mount a volumes"`
Volumes []string `toml:"volumes,omitempty" json:"volumes" long:"volumes" env:"DOCKER_VOLUMES" description:"Bind-mount a volume and create it if it doesn't exist prior to mounting. Can be specified multiple times once per mountpoint, e.g. --docker-volumes 'test0:/test0' --docker-volumes 'test1:/test1'"`
VolumeDriver string `toml:"volume_driver,omitempty" json:"volume_driver" long:"volume-driver" env:"DOCKER_VOLUME_DRIVER" description:"Volume driver to be used"`
CacheDir string `toml:"cache_dir,omitempty" json:"cache_dir" long:"cache-dir" env:"DOCKER_CACHE_DIR" description:"Directory where to store caches"`
ExtraHosts []string `toml:"extra_hosts,omitempty" json:"extra_hosts" long:"extra-hosts" env:"DOCKER_EXTRA_HOSTS" description:"Add a custom host-to-IP mapping"`
......@@ -112,6 +112,7 @@ type ParallelsConfig struct {
BaseName string `toml:"base_name" json:"base_name" long:"base-name" env:"PARALLELS_BASE_NAME" description:"VM name to be used"`
TemplateName string `toml:"template_name,omitempty" json:"template_name" long:"template-name" env:"PARALLELS_TEMPLATE_NAME" description:"VM template to be created"`
DisableSnapshots bool `toml:"disable_snapshots,omitzero" json:"disable_snapshots" long:"disable-snapshots" env:"PARALLELS_DISABLE_SNAPSHOTS" description:"Disable snapshoting to speedup VM creation"`
TimeServer string `toml:"time_server,omitempty" json:"time_server" long:"time-server" env:"PARALLELS_TIME_SERVER" description:"Timeserver to sync the guests time from. Defaults to time.apple.com"`
}
type VirtualBoxConfig struct {
......@@ -171,7 +172,7 @@ type KubernetesConfig struct {
PodLabels map[string]string `toml:"pod_labels,omitempty" json:"pod_labels" long:"pod-labels" description:"A toml table/json object of key-value. Value is expected to be a string. When set, this will create pods with the given pod labels. Environment variables will be substituted for values here."`
ServiceAccount string `toml:"service_account,omitempty" json:"service_account" long:"service-account" env:"KUBERNETES_SERVICE_ACCOUNT" description:"Executor pods will use this Service Account to talk to kubernetes API"`
ServiceAccountOverwriteAllowed string `toml:"service_account_overwrite_allowed" json:"service_account_overwrite_allowed" long:"service_account_overwrite_allowed" env:"KUBERNETES_SERVICE_ACCOUNT_OVERWRITE_ALLOWED" description:"Regex to validate 'KUBERNETES_SERVICE_ACCOUNT' value"`
PodAnnotations map[string]string `toml:"pod_annotations,omitempty" json:"pod_annotations" long:"pod-annotations" description:"A toml table/json object of key-value. Value is expected to be a string. When set, this will create pods with the given annotations. Can be overwritten in build with KUBERNETES_POD_ANNOTATION_* varialbes"`
PodAnnotations map[string]string `toml:"pod_annotations,omitempty" json:"pod_annotations" long:"pod-annotations" description:"A toml table/json object of key-value. Value is expected to be a string. When set, this will create pods with the given annotations. Can be overwritten in build with KUBERNETES_POD_ANNOTATIONS_* varialbes"`
PodAnnotationsOverwriteAllowed string `toml:"pod_annotations_overwrite_allowed" json:"pod_annotations_overwrite_allowed" long:"pod_annotations_overwrite_allowed" env:"KUBERNETES_POD_ANNOTATIONS_OVERWRITE_ALLOWED" description:"Regex to validate 'KUBERNETES_POD_ANNOTATIONS_*' values"`
Volumes KubernetesVolumes `toml:"volumes"`
}
......
FROM alpine:3.8
FROM alpine:3.9
RUN adduser -D -S -h /home/gitlab-runner gitlab-runner
......
FROM multiarch/alpine:armhf-v3.8
FROM multiarch/alpine:armhf-v3.9
RUN apk add --no-cache bash ca-certificates git git-lfs miniperl \
&& ln -s miniperl /usr/bin/perl
......
FROM alpine:3.8
FROM alpine:3.9
RUN apk add --no-cache bash ca-certificates git git-lfs miniperl \
&& ln -s miniperl /usr/bin/perl
......
......@@ -13,6 +13,13 @@ run on your workstation. The added benefit is that you can test all the
commands that we will explore later from your shell, rather than having to test
them on a dedicated CI server.
NOTE: **Note:**
GitLab Runner uses Docker Engine API
[v1.25](https://docs.docker.com/engine/api/v1.25/) to talk to the Docker
Engine. Refer to the [API version
matrix](https://docs.docker.com/develop/sdk/#api-version-matrix) for
compatible versions of Docker.
## Workflow
The Docker executor divides the build into multiple steps:
......@@ -531,4 +538,4 @@ This executor is no longer maintained and will be removed in the near future.
[service-file]: https://gitlab.com/gitlab-org/gitlab-runner/blob/master/dockerfiles/build/scripts/gitlab-runner-service
[privileged]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
[entry]: https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime
[secpull]: ../security/index.md#usage-of-private-docker-images-with-if-not-present-pull-policy
\ No newline at end of file
[secpull]: ../security/index.md#usage-of-private-docker-images-with-if-not-present-pull-policy
# Run GitLab Runner on a Kubernetes cluster
TIP: **Tip:**
We also provide a [GitLab Runner Helm Chart](https://docs.gitlab.com/ce/install/kubernetes/gitlab_runner_chart.html)
To install the GitLab CI Runner on Kubernetes there are several resources that need to be defined and then pushed to the cluster with `kubectl`. This topic covers how to:
1. Define the runner ConfigMap in a yaml file
1. Define the runner Deployment yaml file
1. Push the definitions to a Kubernetes cluster using `kubectl`
To get started with the GitLab CI Runner on Kubernetes you need to define
resources that you can then push to the cluster with `kubectl`.
## Define the Runner `ConfigMap`
Create a file named `runner_config.yml` from the following example:
......
......@@ -201,7 +201,7 @@ func waitForPodRunning(ctx context.Context, c *kubernetes.Clientset, pod *api.Po
return api.PodUnknown, ctx.Err()
}
}
return api.PodUnknown, errors.New("timedout waiting for pod to start")
return api.PodUnknown, errors.New("timed out waiting for pod to start")
}
// limits takes a string representing CPU & memory limits,
......
......@@ -153,6 +153,24 @@ func (s *executor) createVM() error {
return nil
}
func (s *executor) updateGuestTime() error {
s.Debugln("Updating VM date...")
timeServer := s.Config.Parallels.TimeServer
if timeServer == "" {
timeServer = "time.apple.com"
}
err := prl.TryExec(s.vmName, 20, "sudo", "ntpdate", "-u", timeServer)
if err != nil {
s.Debugln("Could not run ntpdate command. Trying the sntp command instead...")
err = prl.TryExec(s.vmName, 20, "sudo", "sntp", "-S", timeServer)
if err != nil {
return err
}
}
return nil
}
func (s *executor) Prepare(options common.ExecutorPrepareOptions) error {
err := s.AbstractExecutor.Prepare(options)
if err != nil {
......@@ -264,9 +282,9 @@ func (s *executor) Prepare(options common.ExecutorPrepareOptions) error {
// TODO: integration tests do fail on this due
// Unable to open new session in this virtual machine.
// Make sure the latest version of Parallels Tools is installed in this virtual machine and it has finished booting
s.Debugln("Updating VM date...")
err = prl.TryExec(s.vmName, 20, "sudo", "ntpdate", "-u", "time.apple.com")
err = s.updateGuestTime()
if err != nil {
s.Println("Could not sync with timeserver!")
return err
}
......
......@@ -19,7 +19,7 @@ import (
)
// The default API version used to create a new docker client.
const DefaultAPIVersion = "1.18"
const DefaultAPIVersion = "1.25"
// IsErrNotFound checks whether a returned error is due to an image or container
// not being found. Proxies the docker implementation.
......
......@@ -74,7 +74,13 @@ func TestServiceLogHook(t *testing.T) {
}
func TestServiceLogHookWithSpecifiedLevel(t *testing.T) {
entry := logrus.NewEntry(logrus.New())
// Disable colors to avoid any OS specific formatting.
formatter := &logrus.TextFormatter{DisableColors: true}
logger := logrus.New()
logger.Formatter = formatter
entry := logrus.NewEntry(logger)
entry.Message = "test message"
sysLogger := new(mockSystemLogger)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment