GithubHelp home page GithubHelp logo

gitlab-runner-fargate's Introduction

Gitlab Runner Fargate

Usage

Setup Fargate

Create a Fargate Cluster

aws ecs create-cluster --cluster-name gitlab-runner-cluster

Register a Task Definition

  • Replace https://gitlab.com if you're using a self-hosted GitLab Instance
  • Replace $REGISTRATION_TOKEN with your own Gitlab runner registration token
  • Update the CPU and memory values if you wish, make sure it's a supported configuration
aws ecs register-task-definition --family gitlab-runner \
--container-definitions "[{\"name\": \"gitlab-runner-instance\",\"image\": \"woodjme/gitlab-runner-fargate\",\"environment\": [{\"name\": \"CI_SERVER_URL\", \"value\": \"https://gitlab.com\"},{\"name\": \"REGISTRATION_TOKEN\", \"value\": \"$REGISTRATION_TOKEN\"},{\"name\": \"RUNNER_NAME\", \"value\": \"fargate\"}]}]" \
--network-mode "awsvpc" \
--requires-compatibilities FARGATE \
--cpu "1024" \
--memory "2048"

Create a Service

You need to replace subnet-xyz with a subnet in your account. You can get this quick with aws ec2 describe-subnets --query 'Subnets[0].SubnetId'

aws ecs create-service --cluster gitlab-runner-cluster \
--service-name gitlab-runner-service \
--task-definition gitlab-runner \
--desired-count 1 \
--launch-type "FARGATE" \
--network-configuration "awsvpcConfiguration={subnets=[subnet-xyz],assignPublicIp=ENABLED}"

Once the service starts you should see a registered runner in GitLab

Limitations

  • Fargate cannot run in privileged mode so running using a Docker executor isn't possible, this means docker builds and pushes can't be done from within these runners.

gitlab-runner-fargate's People

Contributors

woodjme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.