Skip to content

TritonDataCenter/sdc-imgapi

Repository files navigation

sdc-imgapi

This repository is part of the Triton Data Center project. See the contribution guidelines and general documentation at the main Triton project page.

The Image API (IMGAPI) is the API in each Triton data center for managing instance images. It is also the software behind standalone IMGAPI services like https://images.smartos.org and https://updates.tritondatacenter.com.

Development

For an IMGAPI running as part of a Triton Data Center, please start with a CoaL setup. Then a common dev cycle goes something like this:

# Make local changes:
git clone git@github.com:TritonDataCenter/sdc-imgapi.git
cd sdc-imgapi
make

# Sync local changes to the "imgapi0" zone in CoaL:
./tools/rsync-to root@10.99.99.7

Note that this has limitations in that binary modules from, say, a Mac laptop obviously cannot be sync'd to the SmartOS imgapi0 zone.


For a standalone IMGAPI, see the Operator Guide for deployment and update details.

Testing

A mode=dc IMGAPI's test suite is run as follows:

ssh HEADNODE   # e.g. ssh root@10.99.99.7

# Indicate that this is a non-production DC.
touch /lib/sdc/.sdc-test-no-production-data

sdc-login -l imgapi
/opt/smartdc/imgapi/test/runtests

The test suite leaves some test data lying around for faster re-runs of the test suite. You can clean up via:

sdc-login -l imgapi /opt/smartdc/imgapi/test/runtests -c

For standalone IMGAPI instances the test suite is currently broken.

Related Repositories

There are a number of repositories that are relevant for IMGAPI and image management in SmartDataCenter and SmartOS.

Repo Description
https://github.com/TritonDataCenter/sdc-imgapi.git The IMGAPI server. This repository.
https://github.com/TritonDataCenter/node-sdc-clients.git Includes imgapi.js node client library for using IMGAPI.
https://github.com/TritonDataCenter/node-imgmanifest.git Defines the SDC/SmartOS Image manifest spec and support for validation and upgrade of image manifests.
https://github.com/TritonDataCenter/sdc-imgapi-cli.git Includes the *-imgadm tools for common IMGAPI servers, e.g. images-imgadm, sdc-imgadm, updates-imgadm and a framework for tools for other IMGAPI servers.
https://github.com/TritonDataCenter/smartos-live.git Holds the SmartOS imgadm tool (in src/img). This is the tool used on any SmartOS global zone to install image datasets into the zpool to enable provisioning VMs with that image.