Mar 22, 2012

Suse Studio Command Line Client (ssc)

Hello. My name is Andrei Petre, a 2nd year student at Politehnica University of Bucharest, Romania, and I'd like to work on Suse Studio Command Line Client (ssc) during Google Summer of Code 2012, mentored by Cristian Mircea Messel. The GSoC project on the OpenSuse page can be found here.

My motivation for this blog post is to gather ideas, oppinions, or any sort of feedback from the Suse Studio community or anyone familiar with it, and to append them to the current list.

Suse Studio is a browser based Linux image creation tool. You can create a custom Linux OS, with applications and packages of your choosing. It also includes a testdrive, so you can test your appliance (custom created distro) not just by building and running it on a live cd/usb, but within your own browser.
SSC is a command line client which aims to help feed back changes to Studio, so that these are applied to your appliance the next time you build it. It can also query your appliance(s). It would be another approach towards Studio, as the browser interaction is the only option until now. SSC would be easy to use and would help very much in scripting.

A list of commands without their complete list of arguments are:

$  ssc checkout          # checkout the latest changes to an appliance
$  ssc commit            # commit changes to studio
$  ssc status            # show status of the appliance

$  ssc appliance         # manage appliances
$  ssc build             # manage builds
$  ssc file              # manage files
$  ssc package           # manage packages
$  ssc repository        # manage repositories
$  ssc template          # manage templates

$  ssc help [TASK]       # Describe available tasks or one specific task

To clone an existing appliance, you give the below command. You can also use -u and -p for username and password:

$ ssc appliance create web_server --source-id=SOURCE_APPLIANCE_ID 
--username=USERNAME --password=PASSWORD

For these pretty CLI options, SSC uses thor. And for the working with Suse Studio, it uses the studio_api API. After you have created a new appliance, a folder with the #{web_server} name is created, containing a .sscrc file, which stores your credentials (provided above) using yaml.

Here is a list of ideas. Anyone is more than welcome to express his/her ideas by leaving comments :). Actually, I'd be very glad if you do so.
  • check for bugs in current implementation, get some workflow going
  • be able to feed your changes to Studio right from your appliance
  • SSC build to be able to build the appliance locally
    • Cristian provided an idea for this approach to export it in kiwi and build it locally (thanks tigerfoot for the idea)
    • Support not provided by the Studio API

git cherry-picking


I recently read this awesome git tutorial, about what is going on inside git for a day-to-day workflow like checkout, reset, branching, HEAD, commit etc. And I found myself in the bellow situation, when I remembered what I learned. Here's the master branch:

git master branch log

And now, here's my old_dev branch, on which I have some unmerged commits:

git branch from which we cherry-pick

Suppose now that I only what the commit on which old_dev is pointing to (SHA d33957a). Where I to

$ git merge old_dev

from master branch, I would add commit 9fdd36a, which is "buggy" (as the commit message says), and I don't want that. Also, I may be required to resolve some merge conflicts manually. So to "pick" only a specific commit, one uses a cherry-pick from the branch where the commit is wanted to be applied:

$ git cherry-pick d33957a

Now the master branch only has the commit I wanted to add in the first place:

git master branch after cherry-pick