Executes an OCI image using Firecracker.
Logs from the executed process (both stdout and stderr) are sent to stdout. Logs from the executor itself are sent to stderr.
oci-image-executor \
--image-tar image.tar \
--image-config image-firecracker-config.json \
--volume /var/user-code-submission:/app
--volume /tools/binary:/your-binary
/usr/bin/binary-to-execute
--image-tar
: Path to the image tar file, created using docker export--image-config
: Path to an OCI image config file--volume
: Copy a directory or file from the host into the VM (changes will not be synced back to the host)
Many of the scripts in this repository aren't customized to work on macOS, so we use Vagrant to test this locally.
- Create your Vagrant VM:
vagrant up
- SSH into the VM and run tests using a sample image:
vagrant ssh
cd /var/opt/oci-image-executor
make create_test_image # in the vagrant shell
To test the boot time of a barebones image, run the following:
git clone https://github.com/codecrafters-io/oci-image-executor.git
apt install moreutils
bash setup.sh
source ~/.bashrc
(to pickup the GOPATH addition)make create_test_image
make build
make test_boot_time