Commit graph

43 commits

Author SHA1 Message Date
Justin Santa Barbara
3036eb41c1 GCE: Name the image as specified in the manifest
We were hard coding an image name format for GCE, but that doesn't match
what other providers (e.g. AWS) do.

Given that image upload did not work at all previously, no reason to
preserve the existing unusual behaviour.
2016-04-19 11:35:11 -04:00
Justin Santa Barbara
be595efd99 GCE: Rename image in tar file to disk.raw
To register with GCE, the image must be named disk.raw, or else the
gcloud create images command fails.
2016-04-19 11:34:53 -04:00
Justin Santa Barbara
34ee0c1e8d GCE: Allow templating of image description
Expand the description template before passing it to gcloud
2016-04-19 11:34:53 -04:00
Justin Santa Barbara
3e3d59ddf1 GCE: Fix upload of image to gcloud
Two small fixes

* syntax is `gcloud compute images`, not `gcloud compute image`
* --source-uri=<uri> should be a single argument
2016-04-19 11:34:46 -04:00
Anders Ingemann
83b783976c Merge pull request #308 from pmarks-net/master
Do not remove ::1 from the loopback interface.
2016-04-04 23:00:27 +02:00
Zach Marano
070f678807 Add busybox as a required package for GCE. 2016-03-28 21:53:52 -07:00
Paul Marks
15c7d1ccb3 Do not remove ::1 from the loopback interface.
An environment with AF_INET6 sockets but no loopback interface creates
nothing but pain.

If an IPv4 server binds to 0.0.0.0:8080, clients may connect to
0.0.0.0:8080, which automatically picks 127.0.0.1 as a source address.
However, when a server binds to [::]:8080, the absence of ::1 causes
clients to fail with ENETUNREACH.

For a demonstration, run the following in a python shell:

import socket
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
s.bind(("", 0))
print s.getsockname()  # Example: ('::', 39079, 0, 0)
s.listen(10)
c = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
c.connect(s.getsockname())
print c.getsockname(), c.getpeername()

This yields the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 101] Network is unreachable
2016-03-24 17:14:17 -07:00
Zach Marano
d485ef681a Fix typo 2016-03-03 14:29:42 -08:00
Zach Marano
b590a02a8c Fix import. 2016-03-03 14:14:54 -08:00
Zach Marano
2b629d784c Again fix the expand-root script for GCE. The volume is not /dev/loop0
but it should be /dev/sda.
2016-03-03 13:59:01 -08:00
Zach Marano
31a98badcb Fix unused import. 2016-03-02 16:28:11 -08:00
Zach Marano
6c03860eac Fix GCE expand-root since commit/2ece5a66e1e36f30bef3a675e8287ab8c1bcc04f 2016-03-02 12:54:06 -08:00
Zach Marano
c34d7d11c8 Only include bare essential packages in the GCE provider task. Move
extras to the manifest files.
2016-02-29 10:38:34 -08:00
Zach Marano
74a8aae6ac Cleanup package list and add in packages that were being added outside
of bootstrap-vz. Remove i386 kernels that GCE does not support as well
as squeeze, and add in a stretch kernel.
2016-02-26 16:24:20 -08:00
Zach Marano
977b1c23a3 Change location of GCE apt repo's (this is an interim change).
hange gcutil command to gcloud as gcutil is deprecated.
2015-12-15 11:20:49 -08:00
Anders Ingemann
c880a6849a Remove image section in manifest
All provider specific settings have been moved to the
provider section. The image name itself is now located
at the top level and called "name". It is required for all providers.
2015-12-13 19:41:18 +01:00
Tiago Ilieve
3d3c303ee1 Changes 'MoveImage' from loopback to image 2015-10-18 16:35:11 -02:00
Tiago Ilieve
10742f8ca3 gce: the right name isn't GCE or GSE, it's GCS[1]
[1]: https://cloud.google.com/storage/
2015-10-18 16:31:12 -02:00
Tiago Ilieve
0068cdc1a8 gce: fix small typo on UploadImage 2015-10-16 00:06:58 -03:00
Rick Wright
ef429f5e79 Install GCE packages before Manifest packages. 2015-06-22 14:28:22 -07:00
Zach Marano
7484236282 Change the order we clean up the apt state- thereby leaving a current as
of the image build set of apt list files on the resulting image.
2015-06-17 18:12:07 -07:00
Zach Marano
d3a1d22290 Add support for Debian 8 in GCE.
Add support for GPT disks.
Change the default block scheduler to noop for improved performance.
2015-05-19 13:19:12 -07:00
Anders Ingemann
1f6f23e680 Fix #104: Don't verify default target when adding packages 2015-04-29 23:51:55 +02:00
Anders Ingemann
71c7d445ad Fix #217, by introducing class for comparison of releases 2015-04-29 21:38:06 +02:00
Anders Ingemann
5823c9119b Split grub and extlinux installs into separate modules 2015-04-16 22:21:12 +02:00
Rick Wright
0d494fb49e Disable resize on disks larger than 2TB
Change-Id: I9764fe2a06cf47e8c0daf38df41c288c280bd6f7
2015-01-29 16:22:30 -08:00
Tim Smith
7944db886f Enable auto-rootdisk growth on gce-backports.
This commit adds the cloud-initramfs-growroot package to the
installation list for GCE images with backports enabled, and updates
the gce tasklist to add the /etc/init.d/expand-root script
(with provider-appropriate touch-ups) to the image.
2014-10-13 10:02:15 -07:00
Rick Wright
96a1683c26 Fix task ordering to better support customizations
This ensures that preferences are written before apt update and also ensures
that in GCE the backports are added to the sources before the provider-specific
SetPackageRepositories happens.

Change-Id: I3c85f922c49c2a6fbd3c0f2bad1072eff0d098c8
2014-09-08 11:45:55 -07:00
Jimmy Kaplowitz
3bfe9dddf9 Reinstate hostname hook for GCE
This DHCP exit hook to shorten the system hostname on GCE was previously
installed by build-debian-cloud and bootstrap-vz, but seems to have been
inadvertently removed in commit c81045cc6e
as part of a broad cross-cloud cleanup. Again, this was caught by our
validation tests, and we might be done with the fixes at this point.

In this commit, I'm reinstating the hook with a name change and an
explanatory comment, to reduce the risk of this vanishing accidentally
in the future.

Change-Id: I4e7268f8b9ab3b2a7fc8b510898c6fbdd685aa53
2014-08-05 17:56:33 -07:00
Anders Ingemann
9f46bdc519 Merge pull request #131 from jkaplowitz/cloudsdk
Install Cloud SDK, which includes gcutil and gsutil.
2014-08-05 17:12:51 -06:00
Jimmy Kaplowitz
a352f4d576 Installing Cloud SDK which includes gcutil and gsutil. We still don't
have a package for it so laying out the tarball for now.

Change-Id: If66f0f1c074e6077e1ca57375cac9c4832bbd7fc
2014-08-01 20:05:23 -07:00
Anders Ingemann
7ad565cbe9 Merge pull request #126 from jkaplowitz/development
Install ca-certificates on GCE
2014-07-28 21:39:56 +02:00
Jimmy Kaplowitz
e8f04d0baf Install ca-certificates on GCE
Needed to fetch GCE startup scripts over HTTPS, among other reasons.

Change-Id: I89e3afb44f786539b5e3275b5f1f3b7201ab44fd
2014-07-25 09:49:52 -07:00
Jimmy Kaplowitz
c412c4cdcf Fix list of tasks and their ordering
- GCE provider wasn't including the GCE SetHostname task, without which
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=604883 was
  preventing the hostname from getting set after reboot.
- During the GCE build, one of the GCE cleaning tasks was trying to run
  an apt-get update after the build-time resolv.conf file was removed.
  Fix this ordering by moving the network.Remove* tasks to the
  system_cleaning phase as they should have been all along, and adding
  an appropriate ordering rule for the GCE cleaning task.
- Add the fallback http.debian.net mirror after, not before, our mirror.
- The puppet plugin's ApplyPuppetManifest task specified that it should
  run before the network.Remove* tasks within the system_modification
  phase. Now that those tasks have been moved to a later phase
  (system_cleaning), remove this dependency. I have no puppet manifest
  to test this change, but am including it in hopes of avoiding a
  breakage there. Hopefully someone who uses puppet can test this or at
  least confirm that it's correct.

Change-Id: Ieca97f288f456bab119989f4cbc4c3993a755830
2014-07-24 20:20:54 -07:00
Tiago Ilieve
719a6c31b0 Reverting 210999f, as asked by @jkaplowitz 2014-07-25 00:08:07 -03:00
Tiago Ilieve
210999ff5d Remove redundant code from GCE's tasks.apt
GCE's `tasks.apt.SetPackageRepositories` was adding duplicated entries
to apt `info.source_lists`, even ignoring the package mirror specified
on manifest.
2014-07-12 13:28:46 -03:00
Anders Ingemann
9d8821235f Clone packages-kernels.yml pattern to other providers
GCE also gets its own file.
For now, this scales - but we might want to refactor when there is more that just the kernel package we need to choose from
2014-07-09 23:17:05 +02:00
Anders Ingemann
e4a9cc837a Differentiate installation of grub 1.99 and grub 2 2014-07-09 23:17:05 +02:00
Anders Ingemann
03a0746299 Convert every JSON file to YAML
Lines removed: over 500. Readiblity gained: A shitload
Now you can actually get an overview of a manifest on a single screen height.
I am sure that it will also save a lot of hassle when modifying schema in the future.
No more "expected property name" etc. because of an extraneous comma
Comments are of course natively support, so there's no need for this minify_json hokey pokey
2014-07-09 23:17:04 +02:00
Tiago Ilieve
65bdb34d77 Save downloaded gsutil tarball to workspace
`gsutil` tarball was being downloaded to the current working directory
and wasn't removed after its extraction.

This will be useful until #87 is merged.
2014-06-07 13:31:10 -03:00
Anders Ingemann
f3d633780f Use string concatenation instead of format()
String concatenation can at times be easier to read that format().
One should choose whichever approach is more readable.
2014-05-04 13:41:15 +02:00
Anders Ingemann
b25e607388 Move "sections" setting into "packages" section.
Rename it to "components", which is the real name for it (see http://manpages.debian.org/cgi-bin/man.cgi?query=sources.list).
2014-05-03 21:57:12 +02:00
Tomasz Rybak
b327823261 Add Google Cloud Engine (GCE) provider:
* force kpartx to use synchronous mode, removing sleep(10)
 * get image configuration, use it during tarball creation and registration
 * add (non-working, path problems) image registration
 * add cleaning of image from Google keys and repositories
 * add NTP server address in manifest
 * add preference for backport kernels in manifest
 * disable IPv6
 * correctly set host name
2014-05-03 14:25:54 +02:00