diff options
author | Max Illfelder <illfelder@google.com> | 2016-06-16 13:44:38 -0700 |
---|---|---|
committer | Max Illfelder <illfelder@google.com> | 2016-06-16 13:44:38 -0700 |
commit | 8cb44bb6951a25dd9384e75f031bc3f99eddaf78 (patch) | |
tree | bca3a20b41772d5e805004a393ad52c327e3d933 | |
parent | a92f7cdfffa4241067a80eee1676c67a9f22bb84 (diff) | |
parent | 1cc08be3775820979684c20220b31abf752e101c (diff) | |
download | google-compute-image-packages-8cb44bb6951a25dd9384e75f031bc3f99eddaf78.tar.gz |
Merge branch 'development'
-rw-r--r-- | README.md | 61 | ||||
-rw-r--r-- | google_compute_engine/metadata_watcher.py | 3 |
2 files changed, 60 insertions, 4 deletions
@@ -20,6 +20,7 @@ Compute Engine [images](https://cloud.google.com/compute/docs/images). * [Metadata Scripts](#metadata-scripts) * [Configuration](#configuration) * [Packaging](#packaging) +* [Package Distribution](#package-distribution) * [Troubleshooting](#troubleshooting) * [Contributing](#contributing) * [License](#license) @@ -268,9 +269,63 @@ We build the following packages for the Linux guest environment. * Configures the SysLog output that gets sent to serial port output. * Includes bash scripts needed by `instance_setup`. -The package build tools are published. The tools are run on a GCE VM to build -release packages, and the output deb and rpm packages are included in our -GitHub releases. +The package build tools are published in this project. + +## Package Distribution + +The deb and rpm packages used in some GCE images are published to Google Cloud +repositories. Debian 8, CentOS 6 and 7, and RHEL 6 and 7 use these repositories +to install and update the `google-compute-engine` and `google-config` packages. +If you are creating a custom image, you can also use these repositories in your +image. + +**For Debian 8, run the following commands as root:** + +Add the public repo key to your system: +``` +curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - +``` + +Add a source list file `/etc/apt/sources.list.d/google-cloud.list`: +``` +tee /etc/apt/sources.list.d/google-cloud.list << EOM +deb http://packages.cloud.google.com/apt google-cloud-compute-jessie main +deb http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-jessie main +EOM +``` + +Install the packages to maintain the public key over time: +``` +apt-get update; apt-get install google-cloud-packages-archive-keyring +``` + +Install the `google-compute-engine-jessie` and `google-config-jessie` packages: +``` +apt-get update; apt-get install google-compute-engine-jessie google-config-jessie +``` + +**For EL6 and EL7 based distributions, run the following commands as root:** + +Add the yum repo to a repo file `/etc/yum.repos.d/google-cloud.repo` for either +EL6 or EL7. Change `DIST` to either 6 or 7 respectively: +``` +DIST=7 +tee /etc/yum.repos.d/google-cloud.repo << EOM +[google-cloud-compute] +name=Google Cloud Compute +baseurl=https://packages.cloud.google.com/yum/repos/google-cloud-compute-el${DIST}-x86_64 +enabled=1 +gpgcheck=1 +repo_gpgcheck=1 +gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg + https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg +EOM +``` + +Install the `google-compute-engine` and `google-config` packages: +``` +yum install -y google-compute-engine google-config +``` ## Troubleshooting diff --git a/google_compute_engine/metadata_watcher.py b/google_compute_engine/metadata_watcher.py index b8db9b9..2987872 100644 --- a/google_compute_engine/metadata_watcher.py +++ b/google_compute_engine/metadata_watcher.py @@ -17,6 +17,7 @@ import functools import json +import logging import os import socket import time @@ -63,7 +64,7 @@ def RetryOnUnavailable(func): class MetadataWatcher(object): """Watches for changes in metadata.""" - def __init__(self, logger, timeout=60): + def __init__(self, logger=logging, timeout=60): """Constructor. Args: |