hello

command
v0.0.0-...-8223eb1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

Hello app

This directory contains the source for the "hello" pod which is used in the integration tests. All it does is read the port it should run on from its config and responds to HTTP requests to '/'. The binary is compiled and built as a hoist artifact in hoisted-hello_def456.tar.gz so that the integration test does not need to actually compile anyand built as a hoist artifact in hoisted-hello_def456.tar.gz so that the integration test does not need to actually compile anything.

To update:

  • modify the source
  • $ go build # on linux
  • $ p2-bin2pod hello # generates a hoist artifact containing the binary
  • $ mv <tar_gz_location> ../hoisted-hello_def456.tar.gz
  • $ gpg --no-default-keyring --keyring integration/single-node-slug-deploy/pubring.gpg
    --secret-keyring integration/single-node-slug-deploy/secring.gpg -u p2universe --out
    integration/hoisted-hello_def456.tar.gz.sig --detach-sign integration/hoisted-hello_def456.tar.gz
  • remove the other files

config.json

config.json is a runc configuration file that is used to run hello as an "opencontainer" launchable type. In order to do that, the "rootfs" directory must be added alongside config.json containing all the files that should be present in the container's filesytem.

The integration tests (specifically integration/common-provision.sh and integration/travis.sh) use docker to pull down a centos7 image, use "docker extract" to turn it into a tar, and extract the tar in order to provide the rootfs directory. This is to avoid putting the full image in git

The config.json file was generated by running "runc spec" to generate a default config.json file, and then the following modifications were made:

  • set the terminal flag to "false"
  • modify the arguments to be /usr/local/bin/hello (instead of /bin/sh)
  • remove the network namespace. This is necessary so that the integration test running outside of the container can access the port that hello is running on inside the container
  • remove the cgroups mount. It's not needed and it can cause problems if the host machine doesn't have cgroup capability

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL