[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving GCE scripts to Python

2014-01-30 Tomasz Rybak <tomasz.rybak@post.pl>:
Please ignore fact that I'm responding to myself...

I've been working on changing GCE-building scripts
to use new Python code.
Today I managed to build image, and uploaded code
to branch gce-python in my GitHub repository:

I was able to upload image to GCE and run it,
but I was not able to ssh-in to running machine.
It might be something simple (as me forgetting
to configure SSH) or larger problem - e.g. grub
configuration or partitioning.

There are still some tasks to do, when compared
to old GCE code:
1. adding preferences to use kernel from backports
2. cleaning - e.g. removing Google repository
3. uploading image - currently done by 95-register-image
4. fixing apt sources - not all mirror addresses
are used in all files

In new Tasks I called tar and apt directly - it might be better
to use Python modules.

Small feedback regarding current state of affairs.
The most difficult was deciding whether to use existing Tasks
or writing new ones - e.g. for adding multi-lines backports.
Old model was straightforward - it was running shell scripts in
order governed by their (numbered) names. Now we have phases
and dependencies; they add more flexibility (as ability
to skip some steps depending on manifest) but require
completely different mental model.

IMO the most important part of documentation would be graph
of Tasks, their dependencies, and sample order of execution.
This way reader will be able to get "the feeling" of system's
inner workings.

Second biggest problem was with the time it takes to build
image. On my system it takes about 15 minutes to build
image, so agile experimentation is hard ;-)
It forced me to try to come with correct solution
faster, so I'm not complaining to much here.
I do not remember how, but there is a way to create a first debootstrap archive then use this deboostrap on next builds. Debootstrap is usually the longer step, so using a debootstrap archive during development can really speedup your tests.
Andsen cloud tell you how to do this (there must be a command  line option to build-debian-cloud).

I'll try to convert more of the old GCE scripts
soon, but first want to have image working. If someone
sees mistakes - even the most obvious ones - please let
me know.

Best regards.

Tomasz Rybak  GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A  488E C654 FB33 2AD5 9860

gpg key id: 4096R/326D8438  (keyring.debian.org)
Key fingerprint = 5FB4 6F83 D3B9 5204 6335  D26D 78DC 68DB 326D 8438

Reply to: