Giter VIP home page Giter VIP logo

buildkite's Introduction

JuliaGPU Buildkite

This repository contains resources related to the JuliaGPU Buildkite CI infrastructure:

  • a custom Ubuntu-based image that can be based off of another image (e.g. CUDA's images);
  • support for encrypted environment variables in the pipeline, and an environment hook to decode them;
  • Docker Compose templates and systemd service files to tie everything together, and give each job a safe and reproducible execution environment.

Many of these features come from the fact that the JuliaGPU CI is intended to be run on a variety of repositories (and external PRs to those repositories), whereas Buildkite is typically used within the (trusted) boundaries of a single organization.

This README documents how to use the JuliaGPU Buildkite CI. For details on the available agents, or how to add one, see the agents README. Note that this Buildkite set-up is fairly new, and the set-up may still change. Keep an eye on this README if anything breaks.

Adding a repository

If your Julia package can use a GPU, you may use the JuliaGPU CI infrastructure to run tests on a system with a GPU. This is not a general-purpose CI service, and only intended to run GPU-related tests of Julia packages. For all other testing, use public infrastructure (Travis, Github Actions, etc).

Some of the steps below require administrative privileges on the JuliaLang Buildkite instance, so you should coordinate on e.g. the JuliaGPU Slack channel or Discourse category.

  1. Install the Buildkite app. You should check on the link whether the app is already installed for the GitHub organization that hosts your repository. If it isn't, a Buildkite administrator needs to request installation of the app, for which he needs to be part of the GitHub organization. The request then needs to be accepted by an owner of the GitHub organization (organization settings > installed GitHub Apps > Pending GitHub Apps installation requests).

  2. (by a Buildkite admin) Create a new pipeline, using the package's name.

    a. Under Git Repository, select Any account and specify the package's HTTPS clone URL, e.g. https://github.com/JuliaGPU/CUDA.jl.git. Do not use the git:// URL!

    b. Remove the default step.

    c. Grant permission to the JuliaGPU team.

  3. Apply the proposed GitHub webhook settings to your repository.

  4. (by a Buildkite admin) Navigate to the Pipeline Settings.

    a. Under general settings, make the pipeline public by clicking the big green button.

    b. Under GitHub settings, check the box to Build pull requests from third-party forked repositories and to Build tags.

  5. (by a Buildkite admin) Edit the pipeline steps.

    a. Convert to YAML.

    b. Paste the following step to upload a pipeline from the repository:

    steps:
      - label: ":buildkite: Pipeline upload"
        command: buildkite-agent pipeline upload
        branches: "!gh-pages"
        agents:
          queue: "juliagpu"
  6. In your repository, create .buildkite/pipeline.yml. Use this as a starting point:

    env:
      SECRET_CODECOV_TOKEN: "..."
    
    steps:
      - label: "Julia 1.5"
        plugins:
          - JuliaCI/julia#v0.2:
              version: 1.5
          - JuliaCI/julia-test#v0.2: ~
          - JuliaCI/julia-coverage#v0.2:
              codecov: true
        agents:
          queue: "juliagpu"
          cuda: "*"
        if: build.message !~ /\[skip tests\]/
        timeout_in_minutes: 60

    If you want to perform several tests, or introduce test phases, you may want to add additional steps. Note that each step is run in a fresh container (as opposed to how Buildkite normally works), so you need to repeat the set-up that provides Julia (here done by the julia plugin) and/or instantiates your project (done by the julia-test plugin). If you need to send resources across steps, use artifacts.

    For coverage submission to Codecov to work, you need to encrypt your CODECOV_TOKEN and specify it as a global SECRET_CODECOV_TOKEN (see below).

Using secrets

During start-up, agents will scan for SECRET_ environment variables and decrypt their contents for use in the rest of the pipeline. If you want to use this mechanism to provide, say, a secret CODECOV_TOKEN, run the encrypt script in this repository and follow its prompts:

$ ./tools/encrypt
Variable name: CODECOV_TOKEN
Secret value:

Use the following snippet in your pipeline.yml:

env:
  SECRET_CODECOV_TOKEN: "kaIXEN51HinaQ4JGclQcIgxeMMtXDb5uvnP3E2eKrH4Eruf2pKd5QwUGcIVL8+rcWeo5FWj883rNxRQEH3YeCWs6/i7vzs+ORvG51QeCNYQgNqFzPsWRcq5qJYc+JPFbisS7q9nghqWTwr52cnjarD4Xx3ceGorMyS5NvFpCNxMgqHNyGkLvipxcTTJfKZK61bpnbntoIjiIO1XSZKjcxnXFGFnolV9BHCr5v8f7F42n2tUH7X3nDHmTBr1AbO2lFAU9ra/KezHcIf0wg2HcV8LZD0+mj8q/SBPjQZSH7cxwx4Q2eTjT4Sw7xnrBGuySVm8ZPCAV7nRNEHo+VqR+GQ=="

buildkite's People

Contributors

maleadt avatar

Watchers

 avatar  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.