Run

June 13, 2016

Vessels run in a set of isolated namespaces within the operating system. This form of virtualization is known as Linux containers and has inspired a lot of great solutions such as Docker, Kubernetes and many more.

In the background, there are many steps involved in making a vessel run. Let’s give you a high level view:

  • Pulling dependencies: If the recipes that the vessel depends on are not found in the local cache, the daemon will pull them from Spacedecode and update the local cache;

  • Loading config: The daemon reads the vessel’s vessel.yml file for configuration details. It also looks inside the recipe that the vessel inherits and all of its ancestors. Once these are loaded, they are combined into a single specification;

  • Preparing filesystem: After loading the settings, the daemon constructs the vessel’s filesystem by layering the filesystems of all recipes involved into a volume;

  • Starting the main process: Vessels are only running for as long as their main process is running. Even though they are more than capable of running multiple processes, they were actually designed to run a single process. At this point, the main process will start and the vessel will be considered running.

To run a vessel, we use the spaced vessel start command or the UI (which is not covered here).

Usage

Assuming you have already created a vessel, use the following command to run it.

$ spaced vessel start <vessel_id>

Note! To get the ID of the vessel run spaced vessel list or look inside the vessel’s vessel.yml file.

If it all goes well, the vessel should be running.

!Vessel not running? There are many factors that would cause a vessel not to run. The vessel’s lifecycle is determined by the main process keeping it alive. To figure out why your vessel is not running, think about things that would cause the main process to exit. For example: if you are trying to run an Nginx vessel and port 80 is in use, that vessel will not run. For further information, the contents of /var/log/spaced.log might be helpful too.

See also



comments powered by Disqus