Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add getting started w/development guide #667

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docs/developer-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Developer Guide

## Pre-requisites

Start with the following guide to setup pre-requisites:

[Setup-Guide-for-Kubernetes-Developers](https://developer.ibm.com/articles/setup-guide-for-kubernetes-developers/)

**Skip the `kubernetes` steps from the guide above if you don't plan on doing any development for `kubernetes` projects.**

`cri-tools` need the following dependencies installed for a development environment:

- [Go](https://golang.org/doc/install)
- [Build tools](https://github.com/containerd/cri#install-dependencies)

_**Important Note**: `Go` dependencies tend to follow the GitHub project URL path structure, i.e. when installing and trying to use `cri-tools` locally, it should be installed under a folder structure as follows `go/src/github.com/kubernetes-sigs/cri-tools`. Kubernetes is the only exception which does not follow this structure for legacy reasons._

Ensure the following after following the setup:

- There is a `go` directory within `$HOME` and the `go/bin` binary is a part of your `$PATH` environment variable

```bash
$ ls $HOME
go

$ echo $PATH | grep go
PATH=$PATH:/usr/local/go/bin:$HOME/go/bin # $PATH here refers to truncated version of additional `env` paths that are unrelated this guide / setup
```

## Build & install `containerd/cri`

The latest development version of `containerd` or CRI-O is required.

This guide will use `containerd/cri` as the container runtime. You may use CRI-O instead but you may need some additional steps to ensure it works. You can also follow the CRI-O [install guide](https://github.com/cri-o/cri-o/blob/master/install.md#install-packaged-versions-of-cri-o) if you prefer to use the packaged version.

Follow the [`containerd/cri` dev guide](https://github.com/containerd/cri#getting-started-for-developers) to `make` and install the `containerd/cri` runtime.

## Build & install `cri-tools`

You can build and install `cri-tools` as follows:

- Install dependencies:

```bash
$ make install.tools
```

- Build `cri-tools` (`critest` and `crictl`) and install to common location:

```bash
$ make && make install # prefix sudo if run into permissions issues
```

If all goes well at this point you should be able to check for `critest` and `crictl` binaries

```bash
$ which crictl
/usr/local/bin/crictl

$ which critest
/usr/local/bin/critest
```