1
0
mirror of https://github.com/containers/youki synced 2024-09-19 18:37:40 +02:00

prepare Vagrant instead of devcontainer for platforms other than linux.

This commit is contained in:
utam0k 2021-06-19 17:43:56 +09:00
parent b7d639091a
commit 56f0efbe29
7 changed files with 44 additions and 91 deletions

View File

@ -1,15 +0,0 @@
FROM mcr.microsoft.com/vscode/devcontainers/rust:1
WORKDIR /workspaces
RUN curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh
RUN rustup component add rust-src clippy
RUN curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz \
-o /usr/local/cargo/bin/rust-analyzer.gz && gzip -d /usr/local/cargo/bin/rust-analyzer.gz \
&& chmod +x /usr/local/cargo/bin/rust-analyzer
RUN wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.13.5.linux-amd64.tar.gz
RUN mkdir /workspaces/go
ENV PATH $PATH:/usr/local/go/bin
ENV GOPATH /workspaces/go
ENV YOUKI_LOGLEVEL debug
ENV RUNTIME /workspaces/youki/target/x86_64-unknown-linux-gnu/debug/youki
ENTRYPOINT ["sh"]

View File

@ -1,28 +0,0 @@
{
"name": "youki",
"dockerFile": "Dockerfile",
"overrideCommand": true,
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--privileged"
],
"postStartCommand": [
".devcontainer/scripts/init.sh"
],
"extensions": [
"matklad.rust-analyzer"
],
"settings": {
"rust-analyzer.server.path": "/usr/local/cargo/bin/rust-analyzer",
"rust-analyzer.checkOnSave.command": "clippy",
// ref. https://github.com/rust-analyzer/rust-analyzer/issues/6038
"rust-analyzer.diagnostics.disabled": [
"unresolved-import"
]
}
}

View File

@ -1,4 +0,0 @@
#!/bin/bash
RUST_BACKTRACE=full YOUKI_LOG_LEVEL=debug YOUKI_MODE=/var/lib/docker/containers/ dockerd --experimental --add-runtime="youki=/workspaces/youki/target/x86_64-unknown-linux-gnu/debug/youki" &
cargo build

View File

@ -1,9 +0,0 @@
#!/bin/bash
go get github.com/opencontainers/runtime-tools
cd /workspaces/go/src/github.com/opencontainers/runtime-tools
make runtimetest validation-executables
if [ ! -e /workspaces/runtime-tools ]; then
ln -s /workspaces/go/src/github.com/opencontainers/runtime-tools /workspaces
fi
# YOUKI_LOGLEVEL=debug RUNTIME=/workspaces/youki/target/x86_64-unknown-linux-gnu/debug/youki validation/kill/kill.t

View File

@ -1,34 +0,0 @@
#!/bin/bash
test_cases=("default/default.t" "create/create.t" "start/start.t")
# Testing delete and kill is too time consuming.
# test_cases=("default/default.t" "create/create.t" "start/start.t" "delete/delete.t" "kill/kill.t")
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
COLUMNS=$(tput cols)
expect_err_num=8
act_err_num=0
for case in "${test_cases[@]}"; do
title="Running $case"
printf "\n%*s\n" $(((${#title}+$COLUMNS)/2)) "$title"
IFS=$'\n' errors=($(RUST_BACKTRACE=1 cd /workspaces/runtime-tools && ../runtime-tools/validation/$case | grep "not ok"))
if [ ${#errors[@]} -eq 0 ]; then
echo -e "${GREEN}Passed all tess${NC}"
else
for err in "${errors[@]}"; do
act_err_num=$((++act_err_num))
echo $err
done
fi
done
echo
if [ $act_err_num -ne $expect_err_num ]; then
echo -e "${RED}The number of failures was as unexpected.${NC}"
exit 1
fi

View File

@ -33,7 +33,7 @@ youki is not at the practical stage yet. However, it is getting closer to practi
# Getting Started
Local build is only supported on linux.
For other platforms, please use the devcontainer that we prepared.
For other platforms, please use [Vagrantfile](#setting-up-vagrant) that we prepared.
## Requires
@ -105,6 +105,19 @@ $ git submodule update --init --recursive
$ ./integration_test.sh
```
### Setting up Vagrant
You can try youki on platforms other than linux by using the Vagrantfile we have prepared.
```
$ git clone git@github.com:containers/youki.git
$ cd youki
$ vagrant up
$ vagrant ssh
# in virtual machine
$ cd youki # in virtual machine
$ ./build.sh
```
# Community
We also have an active [Discord](https://discord.gg/h7R3HgWUct) if you'd like to come and chat with us.

30
Vagrantfile vendored Normal file
View File

@ -0,0 +1,30 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "fedora/33-cloud-base"
config.vm.provider :virtualbox do |v|
v.memory = 2048
v.cpus = 2
end
config.vm.provider :libvirt do |v|
v.memory = 2048
v.cpus = 2
end
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provision "shell", inline: <<-SHELL
set -e -u -o pipefail
yum install -y git gcc docker
grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
service docker start
SHELL
config.vm.provision "shell", privileged: false, inline: <<-SHELL
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "export PATH=$PATH:$HOME/.cargo/bin" >> ~/.bashrc
git clone https://github.com/containers/youki
SHELL
end