openSUSE:OBS Light Fakeobs

Jump to: navigation, search


Fake OBS

OBSLightWiki.png

Download for openSUSE

Vendor: OBS Light
Developer: OBS Light Team
License: GPLv2
Web: OBS Light on Gitorious


Fake OBS

Fake OBS is a delivery system which can extract project from an OBS system to export them as a simple tar file for use at a remote site. At the remote site, the delivered project is visible as it would be in the original OBS, but as read only.

Technically, Fake OBS is a Python script that partially implements an OBS API. It does not build any code, but can be used as an OBS remote link from any tool which can work with an OBS (e.g. osc, OBS Light or a private OBS instance)

You can use it for example to build your own project against a fixed release of a public project (Tizen, MeeGo...), without the drawbacks of a slow/unreliable internet connection or unplanned update of the public web site. An other use case is to deliver code to customer in order to allow them to build their additional code on your base project without offering a public OBS.

It is delivered from the Mer Delivery System tools and we thank them for their initial contribution.

Installation

The OBS Light client and OBS Light server appliance integrates a FakeOBS server. That is the simplest way to use FakeOBS: OBS Light client OBS Light server appliance.

Version 0.6.x (Legacy)

This version is the old stable version. We recommend you to install the new 1.0.0 version.

We publish packages for openSUSE 11.4 and 12.1 in the repositories of OBS Light. obslight-fakeobs has dependencies on python-async, python-gitdb and python-smmap which can be installed from openSUSE's devel:languages:python repositories.

  • openSUSE 11.4
sudo zypper ar "http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_11.4/devel:languages:python.repo"
sudo zypper ar "http://repo.pub.meego.com/Project:/OBS_Light/openSUSE_11.4/Project:OBS_Light.repo"
sudo zypper in obslight-fakeobs
  • openSUSE 12.1
sudo zypper ar "http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.1/devel:languages:python.repo"
sudo zypper ar "http://repo.pub.meego.com/Project:/OBS_Light/openSUSE_12.1/Project:OBS_Light.repo"
sudo zypper in obslight-fakeobs

Stable Packaged versions

This version is incompatible with 0.6.x versions and older. But there is a migration procedure.

openSUSE

obslight-fakeobs has a dependency on python-cmdln which can be installed from openSUSE's devel:languages:python repositories.

Note:

  • the main repository of opensuse oss, must be active,you can test your maiun repo with:
zypper  se -t pattern base > /dev/null || echo "No opensuse main repository."

For OpenSUSE 12.1

sudo zypper ar "http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/openSUSE_12.1/devel:OBS:Light:Stable.repo"
sudo zypper ar "http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.1/devel:languages:python.repo"

For OpenSUSE 12.2

sudo zypper ar "http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/openSUSE_12.2/devel:OBS:Light:Stable.repo"

install

sudo zypper  --gpg-auto-import-keys refresh
sudo zypper install obslight-fakeobs

Ubuntu

Create /etc/apt/sources.list.d/obslight.list and fill it with

For Ubuntu 11.10

# Ubuntu 11.10
#OBS Light (Stable)
deb http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_11.10/ ./
wget -O - http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_11.10/Release.key | sudo apt-key add -
wget -O - http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_11.10/Release.key | sudo apt-key add -

Ubuntu 12.04

# Ubuntu 12.04
## OBS Light (Stable)
deb http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_12.04/ ./
wget -O - http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_12.04/Release.key | sudo apt-key add -

install

then run

sudo apt-get update
sudo apt-get install obslight-fakeobs

Fedora

Fedora 16

sudo wget http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/Fedora_16/devel:OBS:Light:Stable.repo -O /etc/yum.repos.d/Project_OBS_Light.repo

Fedora 17

cd /etc/yum.repos.d
sudo wget http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/Fedora_17/devel:OBS:Light:Stable.repo -O devel_OBS_Light_Stable.repo
sudo wget http://download.tizen.org/tools/Fedora_17/Tools.repo -O tizen_tools.repo

install

yum makecache
yum install obslight-fakeobs

Test Packaged versions

This version is incompatible with 0.6.x versions and older. But there is a migration procedure.

openSUSE

obslight-fakeobs has a dependency on python-cmdln which can be installed from openSUSE's devel:languages:python repositories.

For OpenSUSE 12.1

sudo zypper ar -f http://download.opensuse.org/repositories/devel:/OBS:/Light:/Head/openSUSE_12.1/devel:OBS:Light:Head.repo
sudo zypper ar "http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_12.1/devel:languages:python.repo"

For OpenSUSE 12.2

sudo zypper ar -f http://download.opensuse.org/repositories/devel:/OBS:/Light:/Head/openSUSE_12.2/devel:OBS:Light:Head.repo

install

sudo zypper  --gpg-auto-import-keys refresh
sudo zypper install obslight-fakeobs

Ubuntu

Create /etc/apt/sources.list.d/obslight.list and fill it with

For Ubuntu 11.10

# Ubuntu 11.10
#OBS Light (Head)
deb http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_11.10/ ./

Save and close the file.

Add Key:

wget -O - http://download.opensuse.org/repositories/devel:/OBS:/Light:/Head/xUbuntu_11.10/Release.key | sudo apt-key add -

Ubuntu 12.04

# Ubuntu 12.04
## OBS Light (Head)
deb http://download.opensuse.org/repositories/devel:/OBS:/Light:/Head/xUbuntu_12.04/ ./

Save and close the file.

Add Key:

wget -O - http://download.opensuse.org/repositories/devel:/OBS:/Light:/Stable/xUbuntu_12.04/Release.key | sudo apt-key add -

install

then run

sudo apt-get update
sudo apt-get install obslight-fakeobs

Fedora

Fedora 16

sudo wget http://download.opensuse.org/repositories/devel:/OBS:/Light:/Head/Fedora_16/devel:OBS:Light:Head.repo -O /etc/yum.repos.d/Project_OBS_Light.repo

Fedora 17

cd /etc/yum.repos.d
sudo wget http://download.opensuse.org/repositories/devel:/OBS:/Light:/Head/Fedora_17/devel:OBS:Light:Head.repo -O /etc/yum.repos.d/Project_OBS_Light.repo
sudo wget http://download.tizen.org/tools/Fedora_17/Tools.repo -O tizen_tools.repo

install

yum makecache
yum install obslight-fakeobs

Usage

  • All commands except list, check and export must be run as root.
  • The program assumes you run it on the same machine hosting your OBS API. It has been designed to work with our appliance: OBS Light server appliance.
  • Starting from version 0.6 you can use it directly from OBS Light client (>= 0.5.3), without a real OBS server.

Import a project from an archive

The name of the project is contained in the archive. If you run this command on an OBS appliance, a project link with name "fakeobs" is automatically created, and the fakeobs project you are importing is added as a pre-configured build target.

obslight-fakeobs import archive.tar.gz

Real world example:

obslight-fakeobs import Tizen_1.0_Base.tar.gz


Import a project from an OBS

Requirements

  • The URL of the OBS public API you want to get project from. Example: "https://api.tizen.org/public".
  • The rsync URL of the root of package repositories. Example: "rsync://download.tizen.org/live".
  • The full name of the project. Example: "Tizen:1.0:Base".
  • Optional: The name of the repository target. Example: "standard".
  • Optional: A list of architectures to grab. Examples: i586, x86_64, armv7el.

If you don't specify repository targets or architectures, all available will be downloaded.

Command line

obslight-fakeobs grab -A <api> -r <repo_url> -t <repository> -a <architecture1> -a <architecture2> <project_name>

Complete example:

obslight-fakeobs grab -A "https://api.tizen.org/public" -r "rsync://download.tizen.org/live" -t standard -a i586 -a armv7el "Tizen:1.0:Base"

This will take some time, depending on your internet connection. After that, the project is installed locally (/srv/obslight-fakeobs/) as if it had been imported from an archive.

Known issues

  • download.meego.com won't let you rsync anonymously, so unless you have a login, you won't be able to grab published binaries.


Import a project from a GBS

Command available since version 1.0.2

Requirements

  • The URL of the GBS you want to get project from. Example: "http://download.tizen.org/releases/2.0alpha/daily/latest/" or "rsync://download.tizen.org/snapshots/2.0alpha/common/latest/".
  • The full name of the project. Example: "Tizen:1.0:Base".
  • The name of the repository target. Example: "ia32". If you don't specify repository targets, nothing will be downloaded.
  • Optional: A list of architectures to grab. Examples: i586, x86_64, armv7el.

If you don't specify architectures, all available will be downloaded.

Command line

obslight-fakeobs grabgbs -t <repository> -a <architecture1> -a <architecture2> -n <project_name> <repo_url> 

Complete example:

obslight-fakeobs grabgbs -t ia32 -o tizen-base -o tizen-main -n Tizen:2.0 -k -f rsync://download.tizen.org/snapshots/2.0alpha/common/latest/

More help

The grab gbs command is more detailled here.

Check a project

obslight-fakeobs check <project_name>

This will:

  • check the existence of a _meta and a _config file, check if they are empty, check that there is no link to a fakeobs project in _meta.
  • check if no RPM is missing in bootstrap (aka :full) and check for their integrity.
  • check for the integrity of the RPMs present in the repositories.
  • check that no files are missing in source packages
  • check that all dependencies of the project are available

List installed projects

obslight-fakeobs list

This will simply list the installed projects. Available options:

  • -u: show update information
  • -t: show the different repository targets of the project
  • -d: show project dependencies for each repository target (implies -t)

Remove a project

obslight-fakeobs remove "Full:Project:Name"

Real world example:

obslight-fakeobs remove "Tizen:1.0:Base"

Shrink a project

Most projects have similar RPMs in their :full and their repositories. The shrink command makes hard links between them, to save space.

obslight-fakeobs shrink "Full:Project:Name"

The -s option makes shrink create symbolic links from :full to the repositories, instead of hard links.

Export a project to an archive

After you have imported a project from an OBS, you can make an archive of it. You may want to shrink the project before exporting it.

obslight-fakeobs export "Full:Project:Name"

Real world example:

obslight-fakeobs export "Tizen:1.0:Base"

After that you can find a big archive in current directory named after the project (with ':' replaced by '_').

Create a project on your OBS linking to the fake OBS

If you installed fakeobs on an OBS appliance, this operation is done automatically when importing a project. However, if you have changed the password or if you don't run in our appliance, you have to call it explicitly. oscrc_file is the path to the OSC configuration file of an administrator-level account (simple users cannot create project links on OBS). This will create a project link called fakeobs:

obslight-fakeobs createlink [-c oscrc_file]

Note: you have to do this only once. All fakeobs projects will be used through the same link.

Build a project against an imported project

After you have imported a project, it has been added as a pre-configured build target. On the OBS web UI, go to the project you want to build, follow Repositories -> Add repositories and you should see the project you have imported under fakeobs distributions.

Add fakeobs repository target.png

Configure fakeobs in OBS Light client

Starting from fakeobs 0.6 and OBS Light 0.5.3, you can build packages from your fakeobs projects in OBS Light.

Configuration parameters for a fakeobs running in server appliance

Web interface URL
http://obslightserver:8000
API URL
http://obslightserver:8001
Repository URL
http://obslightserver:8002/live
Username
anything that you want (no authentication)
Password
anything that you want (no authentication)

Configuration parameters for a fakeobs running on localhost

Note that these parameters are pre-configured in OBS Light GUI wizard as fakeobs.local.

Web interface URL
http://localhost:8000
API URL
http://localhost:8001
Repository URL
http://localhost:8002/live
Username
anything that you want (no authentication)
Password
anything that you want (no authentication)


Web UI

There is a basic web UI on port 8000, which allows to browse projects, packages, and package files.

Configuration

There are some parameters that you can customize in /etc/obslight-fakeobs.conf, which are self-documented. Default configuration should be suitable for most usages.

Migrate from < 1.0.0 versions

Data organization changed between fakeobs-0.6.x and fakeobs-1.0.x. The convert command allows you to import projects which were installed by < 1.0.0 versions. Make a list of project/releases you want to convert before installing the new version. After installing the newest version, check you still have the packages python-async, python-gitdb, python-gitpython and python-smmap and run

obslight-fakeobs convert <project> <release>

for each project/release you want to convert. After checking that everything works as expected, you can remove the old fakeobs directory (/srv/fakeobs).

Project delivery procedure

The following is the recommended procedure for OBS project managers who want to distribute projects to their customers, using Fake OBS.

1. Preparation of the project archive

  • The distributor (the man who prepares the project archives, not necessarily an OBS administrator), grabs the OBS project on his machine
user1@host1# obslight-fakeobs grab -A https://api.myobs.com/public -r rsync://download.myobs.com/live My:OBS:Project
  • To save space (and to reduce the size of the future archive), he shrinks the project
user1@host1# obslight-fakeobs shrink My:OBS:Project
...
10 RPMs linked, saving 11105689 bytes
  • Now he exports the project to an archive
user1@host1# obslight-fakeobs export My:OBS:Project
...
Project 'My:OBS:Project' exported to My_OBS_Project-20120917031317.tar.gz
  • Finally he sends the archive to his customers

2. Import of the project archive

  • The customer downloads the project archive on his machine (or the OBS server he is responsible of) and imports it into Fake OBS
customer@host2# obslight-fakeobs import My_OBS_Project-20120917031317.tar.gz
...
Project 'My:OBS:Project' correctly imported
  • The customer can now check the project to search for possible missing dependencies or broken files
customer@host2# obslight-fakeobs check My:OBS:Project
...
OK

3. Update of a project

  • The distributor finds a bug in his archive (project config, missing package...) and fixes it (we suppose he knows what to do)
  • Instead of re-exporting an archive, he starts an rsync daemon on /srv/obslight-fakeobs.

Here is an example rsync configuration file (/etc/rsyncd.conf):

uid = nobody
gid = nobody
read only = true
use chroot = true
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
slp refresh = 300
use slp = false

[obslight-fakeobs]
path = /srv/obslight-fakeobs
comment = Fake OBS root
  • Then he sends his external rsync URL to the customers of his broken archive: rsync://host1.mynetwork.com/obslight-fakeobs
  • The customers can now update their broken project by running
customer@host2# obslight-fakeobs update -r rsync://host1.mynetwork.com/obslight-fakeobs My:OBS:Project

Note that you can add this URL in /srv/obslight-fakeobs/projects/My:OBS:Project/project_info, field rsync_update_url, to avoid passing -r argument.

FAQ

Where are fakeobs data stored ?

fakeobs data are stored in /srv/obslight-fakeobs and its subdirectories. The daemon log file is /var/log/fakeobs.log.

On which port does fakeobs API listen ?

fakeobs API listens on port 8001. You can test if it is running by calling http://obslightserver:8001/public/source/ in your web browser (replace obslightserver by the appropriate hostname). If you see "Unable to connect", the daemon is probably stopped. Try "service fakeobs start".

On which port are published the package repositories ?

The package repositories are published on port 8002.

Where can I find fakeobs projects archives ?

Some archives for Tizen are available at http://tizen.fridu.net.