summaryrefslogtreecommitdiff
path: root/clientobsserver/README2.4.md
blob: eb04204b2ae6fa6a4df7d428faa6b600fbfd9ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#  Tizen Infra : OBS-Server with Docker

## Introduction
The Open Build Service (OBS) is a generic system to build and distribute packages from sources in an automatic, consistent and reproducible way. It makes it possible to release software for a wide range of operating systems and hardware architectures. (https://en.opensuse.org)

## Version
>     ver 2.4.0.7 ( OBS : 2.4 Docker Image : 0.7)

##Tested on Host OS.

> ##### Host OS : ubuntu 14.04
> 
>     docker version : 1.4.1
>     docker version : 1.6.2     
>     docker version : 1.7.0

> ##### Host OS : opensuse 13.1
>  
>     docker version : 1.3.2
>     docker version : 1.6.2 

## OBS Server Information

> ##### In the default configuration
>     === Server Info ===
>     CPU clock : 2.70GHz	
>     CPU core : 24
>     RAM MEM : 64GB
>     Disk Cache : 2GB
>     HDD : 1TB
>     

## Pre-installed Packages

> ##### Image OS : flavio/opensuse-12-3
>     vim tar wget telnet supervisor sudo
>     obs-server obs-signd obs-utils obs-api git-buildpackage obs-service-gbs
>     obs-source_service qemu-linux-user build-initvm-x86_64 build-initvm-i586 obs-event-plugin
>     apache2 apache2-mod_xforward rubygem-passenger-apache2 memcached
>     php5 php5-gd php5-gettext php5-mbstring php5-mysql
>     php5-pear php5-suhosin apache2-mod_php5 php5-bcmath
>     php5-bz2 php5-calendar php5-curl php5-ftp php5-gmp
>     php5-imap php5-ldap php5-mcrypt php5-odbc php5-openssl
>     php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp
>     php5-soap php5-sockets php5-sysvsem php5-wddx php5-xmlrpc
>     php5-xsl php5-exif php5-fastcgi php5-sysvmsg php5-sysvshm
>     npt iputils
>     perl-GD
>     obs-service-git-buildpackage
>     libcurl4-7.42.1
>     librpm-tizen

## Download

> ##### URL
>     http://cdn.download.tizen.org/services/docker/

## Execution

> ##### Download an images and execute.
>      
> $ wget < url >
> 
> $ ls
> 
>     obsserver_2.4-2.4.0.7-docker-script.tar.gz
> $ tar -xvf obsserver_2.4-2.4.0.7-docker-script.tar.gz
> 
> $ cd clientobsserver
> 
> $ ls
> 
>      config.conf  dobsserver.sh  env  obsserver_2.4-2.4.0.7-docker-image.tar.gz  root
>      
>      #### Description ####
>      * config.conf : Metaconfig file of container
>      * env : Environment variables of container
>      * -docker-image.tar.gz : Docker image 
>         (“$ ./dobsserver.sh load” will load docker image from *-docker-image.tar.gz )
>      * root : Specific configuration files to be applied on container
>
> $ sudo ./dobsserver.sh load
> 
> $ docker images
> 
>     $ docker images 
>     tizendocker:5000/obsserver            2.4.0.7
>
> $ vi env/env.list
>     
>     #If you want to change the password for the MySQL database, you can change it 
>     
>     #If you are use the proxy in your enviroment, pleaese add below line.
>     ftp_proxy=ftp://123.456.789.012
>     http_proxy=http://123.456.789.012
>     https_proxy=https://123.456.789.012
>     socks_proxy=socks://123.456.789.012
>     
>     #If you are use the proxy in your enviroment, pleaese add below line.
>     ftp_proxy=
>     http_proxy=
>     https_proxy=
>     socks_proxy=
>     
> $ vi config.conf
> 
>     # Configuration of the dobsserver.sh
>     # You can be change a hostname. others do not change.
>     export HOSTNAME= #hostname in container
>     
>     #If you remove the Container, because the changed values are deleted,
>     # the backup data must be managed volumes.
>     export VOLUMES="<host dir or filename>:<container dir or filename> 
>
> $ sudo ./dobsserver.sh start
> 
>      $ docker ps
>     1dd1fac2912e        tizendocker:5000/obsserver:2.4.0.7             "/bin/bash /srv/scri   4 hours ago         Up 4 hours         
>      0.0.0.0:80->80/tcp, 0.0.0.0:82->82/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:444->444/tcp, 0.0.0.0:5152->5152/tcp, 
>      0.0.0.0:5252->5252/tcp, 0.0.0.0:5352->5352/tcp      obsserver_2.4
> 
> Finish      


## Connect OBS
>
>     web url : http://localhost:80/ or http:// < ip > /
>     api url : http://localhost:81/ or http:// < ip >:81 /
>     repos url : http://localhost:82/ or http:// < ip >:82 /
>     
>     # Admin password
>     Log in = id : Admin , pw : opensuse

## Setup OBS Service

> If you conncect the download server,jenkins server.
> 
>     #  Attach to a running container
>     $ sudo ./dobsserver.sh attach
>     
>     > vi root/usr/lib/obs/server/BSConfig.pm
>     # 1) Add lines below 
>     our $notification_plugin = "notify_jenkins";
>     our $jenkinsserver = "Jenkins_Server_IP:8080"; (ex. our $jenkinsserver = >     "http://123.456.789.012:8080";)
>     our $jenkinsjob = 'job/obs-event-dispatcher/buildWithParameters';
>     our $jenkinsnamespace = "OBS";
>     our @excl_patterns = ("project:Tizen:.* type:REPO_PUBLISH_STATE",
>                             "type:BUILD_.*",
>                             "type:SRCSRV_COMMIT",
>                             "type:SRCSRV_VERSION_CHANGE");
>     
>     our @incl_patterns = ("project:Tizen:.*",
>                             "project:home:prerelease:.*");
>     # You must modify Jenkins_Server_IP as what you use.
>     # Optional : You can modify (add/ remove lists) "our @excl_patterns" & "our >     @incl_patterns"
>     #  : our @excl_patterns -> obs projects which is excluded from snapshot
>     #   :our @incl_patterns -> obs projects which is triggers jenkins to make snapshot
>
>     # 2) Add proxy IP
>     our $proxy = "Proxy_IP";
>     ex) our $proxy = "http://123.456.789.012/"; 
>     
>     # 3) Add information about stage server.
>     our $stageserver = 'rsync://Download_Server_IP/_live_RW_'; 
>     ex) our $stageserver = 'rsync://123.456.789.012/_live_RW_';
>     
>     # 4) If you are use the proxy in your enviroment
>     > vi /etc/sysconfig/proxy
>       HTTP_PROXY=
>       HTTPS_PROXY=
>       FTP_PROXY=
>
>     # exit a container
>     > exit
>     
>     # restart a container
>     $ sudo ./dobsserver.sh stop
>     
>     $ sudo ./dobsserver.sh start>     
>     

## Setting up for Gerrit accessing

>
>     1. After getting a gerrit account, you need to create an ssh key, 
>     and add your ssh key to Gerrit to enable the connection to gerrit.
>     
>     2. Register your contact info on Gerrit
>        Log into Gerrit.
>        On Gerrit UI, follow the links below to register your email address 
>     and update your full name on Gerrit:
>          a.Settings --> Contact Information --> Register New Email...
>          b.Settings --> Contact Information --> Full Name.
>          
>     3. After you register the email, you will receive an email which contains a link. 
>     Please copy the link to your browser to activate the account.
>     Create SSH keys
>     
>     $ sudo ./dobsserver.sh attach
>     $  cd /root
>     $ ssh-keygen -f id_rsa -t rsa -N ''
>     Generating public/private rsa key pair.
>     Generating public/private rsa key pair.
>     Your identification has been saved in id_rsa.
>     Your public key has been saved in id_rsa.pub.
>     The key fingerprint is:
>     3a:34:9c:35:7c:58:b1:81:9e:b9:64:3d:27:f7:3e:60 root@OBSServer
>     The key's randomart image is:
>     +--[ RSA 2048]----+
>     | .+. |
>     | ..o o |
>     | .=+o |
>     | . o*o+ o |
>     | =oS. = . |
>     | . o. E . |
>     | o . o |
>     | . o |
>     | . |
>     +-----------------+
>     # cat .ssh/id_rsa.pub
>     
>     4. after pressing the Enter key at several prompts, an SSH key-pair will be created in /root/.ssh/id_rsa.pub .
>        Upload SSH pubkey to Gerrit Click the links below to set up the Gerrit WebUI.
>        Settings --> SSH Public Keys --> Add Key...
>        Paste your SSH public key there, and then click 'Add'.
>     5. Verify your SSH connection You can verify your Gerrit connection by executing this command:
>        Make sure to add the server RSA key fingerprint to the known hosts of jenkins account
>        if connect to gerrit server in the first time.
>        If your settings are correct, you'll see the message below. If not, check SSH proxy
>        and SSH public key on Gerrit.
>        $ ssh -p 29418 gerrit_username@gerrit_hostname
>        **** Welcome to Gerrit Code Review ****
>     6. $ vi .ssh/config
>        Host gerrit_hostname
>        Port 29418
>        User gerrit_username
>        IdentityFile ~/.ssh/id_rsa
>     7. Config Git for Gerrit Access After the above installation, which will include git, is complete, you can configure git.
>        $ git config --global user.name "First_Name Last_Name"
>        $ git config --global user.email "account@host"
>    


## Initialize

>  ### remove all data
> 
> $ sudo ./dobsserver.sh stop
> 
> $ sudo rm -rf /home/obsserver_2.4
> 
> $ sudo ./dobsserver.sh rm
> 
> $ sudo ./dobsserver.sh start


##CLI

>
>     USAGE: ./dobsserver.sh COMMAND
>     -e 
>     Commands:
>         start     Start a stopped container
>         attach    Attach to a running container
>         stop      Stop a running container
>         status    Status a running container
>         rm        Remove this containers
>         restart   stop , start a container
>         kill      Kill a running container
>         logs      Fetch the logs of a container
>         cp        Copy files/folders from a container's filesystem to the host path
>         pull      Pull an image or a repository from a Docker registry server
>         inspect   Return low-level information on a containe
>         top       Lookup the running processes of a container
>         save      Save an image to a tar archive
>         load      Load an image from a tar archive
>         help      help

##Troubleshooting

>     --------------------------------------------------------------------------
>     --------------------------------------------------------------------------      
>     --------------------------------------------------------------------------
>     

## Dockerfile

>  If you want to build an image from a Dockerfile, you can find a Dockerfile from review.tizen.org.

##License

> OBS
> 
>      GNU Licenses (http://openbuildservice.org/help/manuals/obs-reference-guide/apb.html)



##References

>     https://en.opensuse.org/openSUSE:Build_Service_private_installation

## Back to [[Setup of Tizen Infrastructure with Docker]]