Installation of Networks-Runner-a in Unix/Linux

Networks Runner is an agent who actually deals with the execution of instructions from a special file .networks-ci.yml

Useful reading:

Installation Networks the server in Unix/Linux

Installation of Networks-Runner-a in Unix/Linux

Now I will tell you how you can configure networks-runner on various Unix/Linux OS. But first, start the services. I’ll use Docker. From the beginning, I want to tell you how I did it in a Docker container. And then, let me give a couple other examples.

My docker-compose.yml file looks like the following:

---
version: '3.7'
services:
networks:
 image: networks networks-ce:latest
 container_name: networks
 hostname: networks.local
labels:
 local.networks.description: "server Networks"
ports:
 - "443:443"
 - "80:80"
 - "2222:22"
dns:
 - 10.17.0.3
 - 1.1.1.1
 - 74.82.42.42
volumes:
 "/usr/local/networks/config:/etc/networks:rw"
 - "/usr/local networks/logs:/var/log/networks:rw"
 "/usr/local/networks/data:/var/opt/networks:rw"
 - "/var/run/docker.sock:/var/run/docker.sock"
extra_hosts:
 networks-runner_local_docker: 172.6.6.20
 socat_container: 172.6.6.2
 restart: always #"no" #always
environment:
 - GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.local:80'; gitlab_rails['gitlab_shell_ssh_port']=2222; gitlab_rails['lfs_enabled'] = true;"
 - DOCKER_HOST=tcp://socat:2375
links:
 - socat
depends_on:
 - socat
networks:
network0:
 ipv4_address: 172.6.6.10
tmpfs:
 - /run
 - /tmp
ulimits:
 nproc: 65535
nofile:
 soft: 20000
 hard: 40000
healthcheck:
 test: ["CMD", "curl", "-f", "http://gitlab.local"]
 interval: 1m30s
 timeout: 10s
 retries: 3
 start_period: 1m30s
networks-runner:
 image: networks networks-runner:latest
 container_name: networks-runner
 hostname: networks-runner.local
labels:
 local.networks-runner.description: "Networks runner"
dns:
 - 10.17.0.3
 - 1.1.1.1
 - 74.82.42.42
volumes:
 - "/usr/local networks/networks-runner/config:/etc/networks:rw"
 - "/usr/local networks/networks-runner/logs:/var/log/networks:rw"
 - "/usr/local networks/networks-runner/data:/home/gitlab_ci_multi_runner/data:rw"
 "/usr/local/bin/docker:/bin/docker"
 - "/var/run/docker.sock:/var/run/docker.sock"
extra_hosts:
 gitlab_local_docker: 172.6.6.10
 socat_container: 172.6.6.2
 restart: "always"
 #"unless-stopped" #"on-failure" #always #"no"
environment:
 - CI_SERVER_URL=http://gitlab_local_docker
 - REGISTRATION_TOKEN=xyLWaXwd15xy6VxU7HUV
 - RUNNER_NAME=networks-runner
 - REGISTER_NON_INTERACTIVE=true
 - REGISTER_LOCKED=false
 - DOCKER_HOST=tcp://socat:2375
links:
 - networks
 - socat
depends_on:
 - networks
 - socat
networks:
network0:
 ipv4_address: 172.6.6.20
tmpfs:
 - /run
 - /tmp
ulimits:
 nproc: 65535
nofile:
 soft: 20000
 hard: 40000
 #command: >
 # sh-c "sleep 300 && register --url=http://gitlab_local_docker 
 # --registration-token=xyLWaXwd15xy6VxU7HUV 
 # --non-interactive=true 
 # --locked=false
 # --name=networks-runner 
 # --executor=docker 
 # --docker-image=docker:stable 
 # --docker-volumes=/var/run/docker.sock:/var/run/docker.sock"
#
#entrypoint:
 # /usr/bin/dumb-init
 # - /entrypoint
 # - run
 # - a --user=networks-runner
 # - --working-directory=/home/networks-runner
#entrypoint:
 # /usr/bin/networks-runner
#command:
 # - register
 # - - url=http://gitlab_local_docker
 # - --registration-token=xyLWaXwd15xy6VxU7HUV
 # - --non-interactive=true
 # - --locked=false
 # - --name=networks-runner
 # - --executor=docker
 # - --docker-image=docker:stable
 # - --docker-volumes=/var/run/docker.sock:/var/run/docker.sock
 # - --docker-privileged
healthcheck:
 test: ["CMD", "curl", "-f", "http://gitlab_local_docker"]
 interval: 1m30s
 timeout: 10s
 retries: 3
 start_period: 1m30s
socat:
 image: bpack/socat
 container_name: socat
 hostname: socat_container
 restart: "on-failure"
 privileged: true
ports:
 - "2375:2375"
dns:
 - 10.17.0.3
 - 1.1.1.1
 - 74.82.42.42
 command: "TCP4-LISTEN:2375,fork,reuseaddr unix-connect:/var/run/docker.sock"
volumes:
 - "/var/run/docker.sock:/var/run/docker.sock"
networks:
network0:
 ipv4_address: 172.6.6.2
healthcheck:
 disable: true
#volumes:
#docker_socket:
#driver_opts:
 # type: none
 # device: "/var/run/docker.sock"
 # o: bind
networks:
network0:
ipam:
 driver: default
config:
 - subnet: 172.6.6.0/24
#

You can run this:

$ docker-compose up-d

Of course saying that, my version is not 100% automatic. After starting services to enableregister up networks-runner and to do this, connect to the Docker container:

$ docker exec-ti networks-runner bash

In the container execute:

$ /usr/bin/dumb-init /register entrypoint --url=http://gitlab_local_docker/ --registration-token=xyLWaXwd15xy6VxU7HUV --non-interactive=true --locked=false --name=networks-runner --executor=docker --docker-image=docker:stable --docker-volumes=/var/run/docker.sock:/var/run/docker.sock

Until I could do everything well. You may have to re-create the container in its Assembly or some options to add. I haven’t investigated this question. Later when you have time and mood.

Go ahead.

Installation of Networks-Runner-Mac OS X

The downloaded binary:

$ sudo curl --output /usr/local/bin/networks-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64

Of course, the correct rights you need to:

$ sudo chmod +x /usr/local/bin/networks-runner

Once put right, you must register hitlab-runner, for example, this can be done in the following way:

$ networks-runner register --url=http://networks.local/ --registration-token=xyLWaXwd15xy6VxU7HUV --non-interactive=true --locked=false --name=networks-runner --executor=docker --docker-image=docker:stable --docker-volumes=/var/run/docker.sock:/var/run/docker.sock

Where:

  • networks-runner Utility.
  • register — Option to register hitlab-runner.
  • url=http://networks.local — URL where based hitlab server.
  • —registration-token=xyLWaXwd15xy6VxU7HUV Token to register runner. You can find in admin panel hitlab server (“Admin Area”-> “Runners”).
  • —non-interactive=true — do Not display output to the screen.
  • —locked=false — Not lochit runner.
  • —name=networks-runner-macosx — Proper name which I couldn’t even hitlab-runner.
  • —executor=docker — Selectable Ekzekutor (docker or shell). I have a docker.
  • —docker-image=docker:stable — Select a Docker image.
  • —docker-volumes=/var/run/docker.sock:/var/run/docker.sock — Toss Docker socket.

For the help command is:

$ networks-runner register-h
Runtime platform arch=amd64, os=linux, pid=137 revision=8bb608ff version=11.7.0
NAME:
 networks-runner register - register a new runner

USAGE:
 networks-runner register [command options] [arguments...]

OPTIONS:
 -c value --config value Config file (default: "/etc/networks-runner/config.toml") [$CONFIG_FILE]
 --tag-list Tag value list [$RUNNER_TAG_LIST]
 -n, --non-interactive Run unattended registration [$REGISTER_NON_INTERACTIVE]
 --leave-runner runner Don't remove if registration fails [$REGISTER_LEAVE_RUNNER]
 -r value --registration-token value Runner's registration token [$REGISTRATION_TOKEN]
 --run-Register untagged untagged builds to run; defaults to 'true' when 'tag-list' is empty [$REGISTER_RUN_UNTAGGED]
 --locked Lock Runner for current project, defaults to 'true' [$REGISTER_LOCKED]
 --maximum-timeout value What is the maximum timeout (in seconds) that will be set for the job when using this Runner (default: "0") [$REGISTER_MAXIMUM_TIMEOUT]
 --to Set Runner to be paused, defaults to 'false' [$REGISTER_PAUSED]
 --name value --description value Runner name (default: "7e2764bb1d36") [$RUNNER_NAME]
 --limit value Maximum number of builds processed by this runner (default: "0") [$RUNNER_LIMIT]
 --output-limit value trace Maximum build size in kilobytes (default: "0") [$RUNNER_OUTPUT_LIMIT]
 --request-concurrency Maximum concurrency value for job requests (default: "0") [$RUNNER_REQUEST_CONCURRENCY]
 -u value --url value Runner URLS [$CI_SERVER_URL]
 -t value, --token token value Runner [$CI_SERVER_TOKEN]
 --tls-ca-file value File containing the certificates to verify the peer when using HTTPS [$CI_SERVER_TLS_CA_FILE]
 --tls-cert-file value File containing the certificate for TLS client auth when using HTTPS [$CI_SERVER_TLS_CERT_FILE]
 --tls-key-file value File containing the private key for TLS client auth when using HTTPS [$CI_SERVER_TLS_KEY_FILE]
 Select value --executor executor, eg. shell, docker, etc. [$RUNNER_EXECUTOR]
 --builds-dir value Directory where builds are stored [$RUNNER_BUILDS_DIR]
 --cache-dir Directory where build value cache is stored [$RUNNER_CACHE_DIR]
 --clone-url value Overwrite the default URL used to clone or fetch the git ref [$CLONE_URL]
 --env value Custom injected environment variables to the build environment [$RUNNER_ENV]
 --pre-clone-script value Runner-specific command script executed before code is pulled [$RUNNER_PRE_CLONE_SCRIPT]
 --pre-build-script value Runner-specific command script executed after the code is pulled, just before the build executes [$RUNNER_PRE_BUILD_SCRIPT]
 --post-build-script value Runner-specific command script executed after the code is pulled and just executes after build [$RUNNER_POST_BUILD_SCRIPT]
 value Select --shell bash, cmd or powershell [$RUNNER_SHELL]
 --ssh-user value User name [$SSH_USER]
 --ssh-password value User password [$SSH_PASSWORD]
 --ssh-host the Remote host value [$SSH_HOST]
 --ssh-port Remote host port value [$SSH_PORT]
 --ssh-identity-file Identity file value to be used [$SSH_IDENTITY_FILE]
 --docker-host Docker daemon address value [$DOCKER_HOST]
 --docker-cert-path Certificate path value [$DOCKER_CERT_PATH]
 --docker-tlsverify Use TLS and verify the remote [$DOCKER_TLS_VERIFY]
 --docker-container Custom hostname value hostname [$DOCKER_HOSTNAME]
 --docker-image value Docker image to be used [$DOCKER_IMAGE]
 --docker-Docker runtime runtime value to be used [$DOCKER_RUNTIME]
 --docker-memory, value Memory limit (format: <number>[<unit>]). Unit can be one of b, k, m, or g. Minimum is 4M. [$DOCKER_MEMORY]
 --docker-memory-swap value of Total memory limit (memory + swap, format: <number>[<unit>]). Unit can be one of b, k, m, or g. [$DOCKER_MEMORY_SWAP]
 --docker-memory-reservation value Memory soft limit (format: <number>[<unit>]). Unit can be one of b, k, m, or g. [$DOCKER_MEMORY_RESERVATION]
 --docker-cpuset-cpus value String value containing the CpusetCpus to use cgroups [$DOCKER_CPUSET_CPUS]
 --docker-value cpus Number of CPUs [$DOCKER_CPUS]
 --docker-dns value A list of DNS servers for the container to use [$DOCKER_DNS]
 --docker-dns-search value A list of DNS search domains [$DOCKER_DNS_SEARCH]
 --docker-privileged Give extended privileges to container [$DOCKER_PRIVILEGED]
 --docker-disable-entrypoint-overwrite Disable the possibility for a container to overwrite the default entrypoint of the image [$DOCKER_DISABLE_ENTRYPOINT_OVERWRITE]
 --docker-User namespace userns value to use [$DOCKER_USERNS_MODE]
 --docker-cap-add value Add Linux capabilities [$DOCKER_CAP_ADD]
 --docker-cap-drop value Drop Linux capabilities [$DOCKER_CAP_DROP]
 --docker-oom-kill-disable Do not kill processes in a container if an out-of-memory (OOM) error occurs [$DOCKER_OOM_KILL_DISABLE]
 --docker-security-opt value Security Options [$DOCKER_SECURITY_OPT]
 --docker-devices value Add a host device to the container [$DOCKER_DEVICES]
 --docker-disable-cache Disable caching all container [$DOCKER_DISABLE_CACHE]
 --docker-volumes value a Bind mount volumes [$DOCKER_VOLUMES]
 --docker-volume-driver Volume driver value to be used [$DOCKER_VOLUME_DRIVER]
 --docker-cache-dir value the Directory where to store caches [$DOCKER_CACHE_DIR]
 --docker-extra-hosts value Add a custom host-to-IP mapping [$DOCKER_EXTRA_HOSTS]
 --docker-volumes-from value A list of volumes to inherit from another container [$DOCKER_VOLUMES_FROM]
 --docker-network-mode value Add container to a custom network [$DOCKER_NETWORK_MODE]
 --docker-links value Add link to another container [$DOCKER_LINKS]
 --docker-services value Add service that is started with container [$DOCKER_SERVICES]
 --docker-wait-for-services-timeout value How long to wait for service startup (default: "0") [$DOCKER_WAIT_FOR_SERVICES_TIMEOUT]
 --docker-allowed-Whitelist allowed images value images [$DOCKER_ALLOWED_IMAGES]
 --docker-allowed-value services allowed services Whitelist [$DOCKER_ALLOWED_SERVICES]
 --docker-pull-policy value Image pull policy: never, if-not-present, always [$DOCKER_PULL_POLICY]
 --docker-shm-sized value Shared memory size for docker images (in bytes) (default: "0") [$DOCKER_SHM_SIZE]
 --docker-tmpfs value A toml table/json object with the format of key=values. When set this will mount the specified path in the key as a tmpfs volume in the main container, using the options specified as key. For the supported options, see the documentation for the unix 'mount' command (default: "{}") [$DOCKER_TMPFS]
 --docker-services-tmpfs value A toml table/json object with the format of key=values. When set this will mount the specified path in the key as a tmpfs volume in all the service containers, using the options specified as key. For the supported options, see the documentation for the unix 'mount' command (default: "{}") [$DOCKER_SERVICES_TMPFS]
 --docker-sysctls Sysctl value options, a toml table/json object of key=value. Value is expected to be a string. (default: "{}") [$DOCKER_SYSCTLS]
 --docker-helper-image value [ADVANCED] Override the default helper image used to clone repos and upload artifacts [$DOCKER_HELPER_IMAGE]
 --parallels-base-name value VM name to be used [$PARALLELS_BASE_NAME]
 --parallels-template-name value in VM template to be created [$PARALLELS_TEMPLATE_NAME]
 --parallels-disable-Disable snapshoting snapshots to speedup VM creation [$PARALLELS_DISABLE_SNAPSHOTS]
 --virtualbox-base-name value VM name to be used [$VIRTUALBOX_BASE_NAME]
 --virtualbox-base-snapshot value Name or UUID of a specific VM snapshot to clone [$VIRTUALBOX_BASE_SNAPSHOT]
 --virtualbox-disable-Disable snapshoting snapshots to speedup VM creation [$VIRTUALBOX_DISABLE_SNAPSHOTS]
 --cache-type value Select caching method [$CACHE_TYPE]
 --cache-path value Name of the path to prepend to the cache URL [$CACHE_PATH]
 --cache-Enable shared cache sharing between runners. [$CACHE_SHARED]
 --cache-s3-server-address value A host:port to the used S3-compatible server [$CACHE_S3_SERVER_ADDRESS]
 --cache-s3-access-key value S3 Access Key [$CACHE_S3_ACCESS_KEY]
 --cache-s3-secret-key value S3 Secret Key [$CACHE_S3_SECRET_KEY]
 --cache-s3-bucket-name value Name of the bucket where cache will be stored [$CACHE_S3_BUCKET_NAME]
 --cache-s3-bucket-location Name value of S3 region [$CACHE_S3_BUCKET_LOCATION]
 --cache-s3-insecure Use insecure mode (without https) [$CACHE_S3_INSECURE]
 --cache-gcs-access-id value ID of the GCP Service Account used to access the storage [$CACHE_GCS_ACCESS_ID]
 --cache-gcs-private-key value Private key used to sign requests GCS [$CACHE_GCS_PRIVATE_KEY]
 --cache-gcs-credentials-file value File with GCP credentials, containing AccessID and PrivateKey [$GOOGLE_APPLICATION_CREDENTIALS]
 --cache-gcs-bucket-name value Name of the bucket where cache will be stored [$CACHE_GCS_BUCKET_NAME]
 --cache-s3-cache-path value Name of the path to prepend to the URL cache. DEPRECATED [$S3_CACHE_PATH]
 --cache-cache-Enable shared cache sharing between runners. DEPRECATED
 --machine-idle-nodes value Maximum idle machines (default: "0") [$MACHINE_IDLE_COUNT]
 --machine-idle-time value Minimum time after the node can be destroyed (default: "0") [$MACHINE_IDLE_TIME]
 --machine-max-builds value Maximum number of builds processed by machine (default: "0") [$MACHINE_MAX_BUILDS]
 --machine-machine-driver value The driver to use when creating the machine [$MACHINE_DRIVER]
 --machine-machine-name value, The template for a machine name (needs to include '%s') [$MACHINE_NAME]
 --machine-machine-options value Additional machine creation options [$MACHINE_OPTIONS]
 --machine-off-peak-periods value Time periods when the scheduler is in the OffPeak mode [$MACHINE_OFF_PEAK_PERIODS]
 --machine-off-peak-timezone the Timezone value for the OffPeak periods (defaults to Local) [$MACHINE_OFF_PEAK_TIMEZONE]
 --machine-off-peak-idle-count value Maximum idle machines when the scheduler is in the OffPeak mode (default: "0") [$MACHINE_OFF_PEAK_IDLE_COUNT]
 --machine-off-peak-idle-time value Minimum time after the machine can be destroyed when the scheduler is in the OffPeak mode (default: "0") [$MACHINE_OFF_PEAK_IDLE_TIME]
 --kubernetes-Kubernetes host value Optional master host URL (auto-discovery attempted if not specified) [$KUBERNETES_HOST]
 --kubernetes-cert-file value Optional Kubernetes master auth certificate [$KUBERNETES_CERT_FILE]
 --kubernetes-key-file value Optional Kubernetes master private key auth [$KUBERNETES_KEY_FILE]
 --kubernetes-ca-file Optional value Kubernetes master auth ca certificate [$KUBERNETES_CA_FILE]
 --kubernetes-bearer_token_overwrite_allowed Bool to authorize builds to specify their own bearer token for creation. [$KUBERNETES_BEARER_TOKEN_OVERWRITE_ALLOWED]
 --kubernetes-Kubernetes bearer_token value Optional service account token used to start build pods. [$KUBERNETES_BEARER_TOKEN]
 --kubernetes-image value Default docker image to use for builds when none is specified [$KUBERNETES_IMAGE]
 --kubernetes-namespace value Namespace to run Kubernetes jobs in [$KUBERNETES_NAMESPACE]
 --kubernetes-namespace_overwrite_allowed Regex value to validate 'KUBERNETES_NAMESPACE_OVERWRITE' value [$KUBERNETES_NAMESPACE_OVERWRITE_ALLOWED]
 --kubernetes-privileged Run all containers with the privileged flag enabled [$KUBERNETES_PRIVILEGED]
 --kubernetes-cpu-limit value of The CPU allocation given to build containers [$KUBERNETES_CPU_LIMIT]
 --kubernetes-memory-limit value The amount of memory allocated to build containers [$KUBERNETES_MEMORY_LIMIT]
 --kubernetes-service-cpu-limit value of The CPU allocation given to the build service containers [$KUBERNETES_SERVICE_CPU_LIMIT]
 --kubernetes-service-memory-limit value The amount of memory allocated to the build service containers [$KUBERNETES_SERVICE_MEMORY_LIMIT]
 --kubernetes-helper-cpu-limit value of The CPU allocation given to build helper containers [$KUBERNETES_HELPER_CPU_LIMIT]
 --kubernetes-helper-memory-limit value The amount of memory allocated to the build helper containers [$KUBERNETES_HELPER_MEMORY_LIMIT]
 --kubernetes-cpu-request value The CPU allocation requested for build containers [$KUBERNETES_CPU_REQUEST]
 --kubernetes-memory-request, value The amount of memory requested from the build containers [$KUBERNETES_MEMORY_REQUEST]
 --kubernetes-service-cpu-request value The CPU allocation requested for the build service containers [$KUBERNETES_SERVICE_CPU_REQUEST]
 --kubernetes-service-memory-request, value The amount of memory requested for the build service containers [$KUBERNETES_SERVICE_MEMORY_REQUEST]
 --kubernetes-helper-cpu-request value The CPU allocation requested for build helper containers [$KUBERNETES_HELPER_CPU_REQUEST]
 --kubernetes-helper-memory-request, value The amount of memory requested for build helper containers [$KUBERNETES_HELPER_MEMORY_REQUEST]
 --kubernetes-pull-policy value Policy for if/when to pull a container image (never / if-not-present, always). The system default will be used if not set [$KUBERNETES_PULL_POLICY]
 --kubernetes-node-selector value A toml table/json object of key=value. Value is expected to be a string. When set this will create k8s pods on nodes that match all the key=value pairs. (default: "{}")
 --kubernetes-image-pull-secrets value of A list of image pull secrets that are used for pulling docker image [$KUBERNETES_IMAGE_PULL_SECRETS]
 --kubernetes-helper-image value [ADVANCED] Override the default helper image used to clone repos and upload artifacts [$KUBERNETES_HELPER_IMAGE]
 --kubernetes-terminationGracePeriodSeconds value of the Duration after the running processes in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. (default: "0") [$KUBERNETES_TERMINATIONGRACEPERIODSECONDS]
 --kubernetes-poll-interval value How frequently, in seconds, the runner will poll the Kubernetes pod it has just created to check its status (default: "0") [$KUBERNETES_POLL_INTERVAL]
 --kubernetes-poll-timeout, value The total amount of time, in seconds, that needs to pass before the runner will timeout attempting to connect to the pod it has just created (useful for queueing more builds that the cluster can handle at a time) (default: "0") [$KUBERNETES_POLL_TIMEOUT]
 --kubernetes-pod-labels value 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. The Environment variables will be substituted for values here. (default: "{}")
 --kubernetes-service-account value Executor pods will use this Service Account to talk to kubernetes API [$KUBERNETES_SERVICE_ACCOUNT]
 --kubernetes-service_account_overwrite_allowed Regex value to validate 'KUBERNETES_SERVICE_ACCOUNT' value [$KUBERNETES_SERVICE_ACCOUNT_OVERWRITE_ALLOWED]
 --kubernetes-pod-annotations value 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 the build with KUBERNETES_POD_ANNOTATION_* varialbes (default: "{}")
 --kubernetes-pod_annotations_overwrite_allowed Regex value to validate 'KUBERNETES_POD_ANNOTATIONS_*' values [$KUBERNETES_POD_ANNOTATIONS_OVERWRITE_ALLOWED]

Install Runner as a service and run it:

$ cd ~
$ networks-runner install
$ networks-runner start

For updates, you have to follow the same steps that I described earlier, but before that, you should stop the service.

That’s all the use.

Installation of Networks-Runner-and in GNU/Linux

Download binary depending on bitness and OS architecture.

If you have, Linux x86-64:

$ sudo wget -O /usr/local/bin/networks-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

If you have, Linux x86:

$ sudo wget -O /usr/local/bin/networks-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-386

If you have a Linux arm:

$ sudo wget -O /usr/local/bin/networks-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm

Of course, the correct rights you need to:

$ sudo chmod +x /usr/local/bin/networks-runner

If you want, if you want to use Docker, install Docker with:

$ curl -sSL https://get.docker.com/ | sh

Create user Networks CI:

$ sudo useradd --comment 'Networks Runner' --create-home networks-runner --shell /bin/bash

Once put right, you need to install Runner as a service and start it:

$ sudo networks-runner install --user=networks-runner --working-directory=/home/networks-runner
$ sudo networks-runner start

Then, register hitlab-runner, for example, this can be done in the following way:

$ networks-runner register --url=http://networks.local/ --registration-token=xyLWaXwd15xy6VxU7HUV --non-interactive=true --locked=false --name=networks-runner --executor=docker --docker-image=docker:stable --docker-volumes=/var/run/docker.sock:/var/run/docker.sock

Where:

  • networks-runner Utility.
  • register — Option to register hitlab-runner.
  • url=http://networks.local — URL where based hitlab server.
  • —registration-token=xyLWaXwd15xy6VxU7HUV Token to register runner. You can find in admin panel hitlab server (“Admin Area”-> “Runners”).
  • —non-interactive=true — do Not display output to the screen.
  • —locked=false — Not lochit runner.
  • —name=networks-runner-linux — in Fact the name with which I couldn’t even hitlab-runner.
  • —executor=docker — Selectable Ekzekutor (docker or shell). I have a docker.
  • —docker-image=docker:stable — Select a Docker image.
  • —docker-volumes=/var/run/docker.sock:/var/run/docker.sock — Toss Docker socket.

For updates, you have to follow the same steps that I described earlier, but before that, you should stop the service.

PS: of Course if someone is used to install software through packages, you can install hitlab-runner through the floor. Give a couple of examples:

For Debian or Ubuntu:

$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/deb/gitlab-runner_i386.deb
$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/deb/gitlab-runner_amd64.deb
$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/deb/gitlab-runner_armel.deb
$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/deb/gitlab-runner_armhf.deb

And in order to install, you can run:

$ dpkg-i networks-runner_386.deb

For RedHat or CentOS:

$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/rpm/gitlab-runner_i686.rpm
$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/rpm/gitlab-runner_amd64.rpm
$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/rpm/gitlab-runner_arm.rpm
$ wget https://s3.amazonaws.com/gitlab-runner-downloads/master/rpm/gitlab-runner_armhf.rpm

To install:

$ rpm-i networks-runner_386.rpm

PS: If you have problems with the links, try to use http/https (depending on what you use at the moment).

That’s all the use.

Installation of Networks-Runner-a FreeBSD

It was not necessary!

Installation of Networks-Runner-and using the docker container in Unix/Linux

You can start the container, for example as follows:

$ docker run-d --name networks-runner --restart always networks/networks-runner:latest

Or:

$ docker run-d --name networks-runner --restart always 
 -v /srv/networks-runner/config:/etc/networks-runner 
 -v /var/run/docker.sock:/var/run/docker.sock 
 networks networks-runner:latest

But after creating the container, should it go:

$ docker exec-ti-u root networks-runner bash

And run the check I described earlier several times.

Installation of Networks-Runner-and using Kubernetes

There was no necessity as yet.

That’s all, “Install Networks-Runner-and in the Unix/Linux” is completed.

Source: linux-notes.org

(Visited 44 times, 1 visits today)