Skip to content

Commit 4b96616

Browse files
authored
Merge pull request #667 from adams0619/dev-guide
docs: add getting started w/development guide
2 parents 0f5f734 + 9abf4f6 commit 4b96616

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

docs/developer-guide.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Developer Guide
2+
3+
## Pre-requisites
4+
5+
Start with the following guide to setup pre-requisites:
6+
7+
[Setup-Guide-for-Kubernetes-Developers](https://developer.ibm.com/articles/setup-guide-for-kubernetes-developers/)
8+
9+
**Skip the `kubernetes` steps from the guide above if you don't plan on doing any development for `kubernetes` projects.**
10+
11+
`cri-tools` need the following dependencies installed for a development environment:
12+
13+
- [Go](https://golang.org/doc/install)
14+
- [Build tools](https://github.com/containerd/cri#install-dependencies)
15+
16+
_**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._
17+
18+
Ensure the following after following the setup:
19+
20+
- There is a `go` directory within `$HOME` and the `go/bin` binary is a part of your `$PATH` environment variable
21+
22+
```bash
23+
$ ls $HOME
24+
go
25+
26+
$ echo $PATH | grep go
27+
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
28+
```
29+
30+
## Build & install `containerd/cri`
31+
32+
The latest development version of `containerd` or CRI-O is required.
33+
34+
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.
35+
36+
Follow the [`containerd/cri` dev guide](https://github.com/containerd/cri#getting-started-for-developers) to `make` and install the `containerd/cri` runtime.
37+
38+
## Build & install `cri-tools`
39+
40+
You can build and install `cri-tools` as follows:
41+
42+
- Install dependencies:
43+
44+
```bash
45+
$ make install.tools
46+
```
47+
48+
- Build `cri-tools` (`critest` and `crictl`) and install to common location:
49+
50+
```bash
51+
$ make && make install # prefix sudo if run into permissions issues
52+
```
53+
54+
If all goes well at this point you should be able to check for `critest` and `crictl` binaries
55+
56+
```bash
57+
$ which crictl
58+
/usr/local/bin/crictl
59+
60+
$ which critest
61+
/usr/local/bin/critest
62+
```

0 commit comments

Comments
 (0)