Skip to content

Commit

Permalink
docs: add getting started/development guide
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTomecek committed Sep 23, 2015
1 parent 71b548d commit 8d0ffe4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Python module and command line client for OpenShift Build Service.

It is able to query OpenShift v3 for various stuff related to building images. It can initiate builds, list builds, get info about builds, get build logs... All of this can be done from command line and from python.

## Getting Started

We have [a guide](https://github.com/projectatomic/osbs-client/blob/master/docs/development-setup.md) how to setup OpenShift in a docker container so you can try it out.


## Configuration

You should set up a configuration file for your instance, sample:
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
origin:
image: "openshift/origin:v1.0.6"
net: "host"
privileged: true
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:rw
- /var/lib/openshift/openshift.local.volumes:/var/lib/openshift/openshift.local.volumes
command: start
49 changes: 49 additions & 0 deletions docs/development-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Local Development

It's actually very simple to setup OpenShift locally. We'll use a docker image from Docker Hub. For more OpenShift-focused information, see [this guide](https://docs.openshift.org/latest/getting_started/administrators.html).

First thing to do is to clone this git repo:

```
$ git clone git@github.com:projectatomic/osbs-client.git
$ cd osbs-client
```

We have a docker-compose config to run OpenShift:

```
$ docker-compose up -d
```

In order to successfully build an image you need to have 3 things:

1. permission to submit a build — for development it's fine to do this (never do that on a public system!):
```
$ docker exec -ti $openshift_container bash
$ oadm policy add-role-to-group edit system:unauthenticated system:authenticated
```


2. buildroot image — see [this section](https://github.com/projectatomic/osbs-client/blob/master/docs/osbs_instance_setup.md#atomic-reactor) section in [deplyoment guide](https://github.com/projectatomic/osbs-client/blob/master/docs/osbs_instance_setup.md)

3. make OpenShift API accessible so build can submit metadata once build is done:
```
$ firewall-cmd --permanent --add-port 8443/tcp
$ firewall-cmd --add-port 8443/tcp
```

4. config for osbs-client; something like this should do
```
[local]
openshift_uri = https://172.17.42.1:8443/
sources_command = fedpkg sources
registry_uri = <registry:5000>
vendor = <this_company>
authoritative_registry = <registry.example.com>
build_host = <builder.example.com>
architecture = x86_64
build_type = prod
verify_ssl = false
metadata_plugin_use_auth = false
use_auth=false
```

0 comments on commit 8d0ffe4

Please sign in to comment.