Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spt renames #23

Merged
merged 23 commits into from
Feb 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@
path = rumprun-packages
url = https://github.com/nabla-containers/rumprun-packages
branch = solo5
[submodule "solo5"]
path = solo5
url = https://github.com/nabla-containers/solo5
branch = ukvm-linux-seccomp
[submodule "gorump"]
path = gorump
url = https://github.com/nabla-containers/gorump
39 changes: 30 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -5,19 +5,40 @@
#
# Based on the opencontainers/runc .travis.yml file.

language: c

dist: xenial
sudo: required
services:
- docker
language: c
cache: ccache
compiler:
- gcc
git:
submodules: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6

before_script:
- sudo apt-get update -y
- sudo apt-get install qemu-kvm libxen-dev libseccomp-dev bats genisoimage sudo iproute2 wget -y
- sudo apt-get install --only-upgrade binutils gcc -y
- export CC=gcc-6
- export CXX=g++-6

before_install:
- echo "deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
- sudo apt-get -qq update
- sudo apt-get install -y make gcc g++ libseccomp-dev/trusty-backports genisoimage
- env | grep TRAVIS_
env:
- PLATFORM=solo5 MACHINE=x86_64

script:
- git submodule update --init --recursive
- bash travis_wait.sh 60 make -j2 --quiet world
- export CC=gcc-6
- export CXX=g++-6
- (cd rumprun && NOGCCERROR=1 ./build-rr.sh -o obj -j16 -qq ${PLATFORM})
- bash travis_wait.sh 60 make --quiet -C go-base gorump
- bash travis_wait.sh 60 make --quiet -C nginx-base
- bash travis_wait.sh 60 make --quiet -C node-base
- make integration
#- make --quiet -C go-base build_docker
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -34,8 +34,6 @@ distclean:
make -C redis-base distclean
make -C go-base distclean

gotest:
make -C tests/gotest

integration: gotest
integration:
make -C tests
sudo tests/bats-core/bats -p tests/integration
18 changes: 5 additions & 13 deletions Makefile.inc
Original file line number Diff line number Diff line change
@@ -36,24 +36,16 @@ submodule_warning:

endif

libsolo5 = $(TOP)/rumprun/rumprun-solo5/rumprun-x86_64/lib/rumprun-solo5/libsolo5_seccomp.a

.PHONY: rumprun
rumprun: FORCE submodule_warning $(libsolo5)
make -C $(TOP)/rumprun build
rumprun: rumprun_stamp

$(libsolo5): FORCE solo5
install -m 664 -D $(TOP)/solo5/kernel/ukvm/solo5.o $@
rumprun_stamp: submodule_warning
make -C $(TOP)/rumprun build
touch $@

rumprun-clean:
make -C $(TOP)/rumprun clean

.PHONY: solo5
solo5: FORCE submodule_warning
make -C $(TOP)/solo5

solo5-clean:
make -C $(TOP)/solo5 clean
rm rumprun_stamp

.PHONY: FORCE

27 changes: 22 additions & 5 deletions go-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
FROM ubuntu:16.04

RUN apt-get update
RUN apt-get install -y build-essential git
# rumprun can only be built with gcc-6
# XXX: Not only that, this version has to match whatever
# gcc was used to build rumprun in the host.
RUN apt-get update && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's combine this with the previous two commands into 1 RUN command so it will just be 1 layer. It'll help us remove the redundant apt-get update too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

build-essential git -y && \
apt-get install build-essential software-properties-common -y && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update && \
apt-get install gcc-snapshot -y && \
apt-get update && \
apt-get install gcc-6 g++-6 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
apt-get install gcc-4.8 g++-4.8 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

RUN mkdir /gopath
RUN mkdir /goapp

ADD rumprun-solo5 /root/unikernels/nabla-base-build/rumprun
ADD gorump /gorump
# XXX: this is pretty inconvenient. Turns out that rumprun
# needs to be at exactly the same place where it was built.
# (unless I'm missing something).
ARG host_rumproot
COPY rumprun-solo5 ${host_rumproot}
COPY gorump /gorump

COPY gomaincaller.go /goapp
COPY _gorump_main.c /goapp
COPY Makefile.goapp /goapp

ENV PATH="/root/unikernels/nabla-base-build/rumprun/rumprun-solo5/bin:${PATH}"
ENV PATH="${host_rumproot}/rumprun-solo5/bin:${PATH}"
ENV CC="x86_64-rumprun-netbsd-gcc"
ENV GOROOT="/gorump"
ENV GOPATH="/gopath"
16 changes: 10 additions & 6 deletions go-base/Makefile
Original file line number Diff line number Diff line change
@@ -39,18 +39,22 @@ gobootstrap: FORCE
curl -L https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz | tar xz -C $(GOBOOTSTRAP) --strip-components=1

.PHONY: gorump
gorump: gobootstrap rumprun solo5 FORCE
source $(RUMPRUN)/obj/config-PATH.sh && cd $(GORUMP)/go/src && CGO_ENABLED=0 GOROOT_BOOTSTRAP=$(GOBOOTSTRAP) GOOS=rumprun GOARCH=amd64 ./make.bash && cd $(GOBASE)
gorump: gorump_stamp

gorump_stamp: gobootstrap rumprun
source $(RUMPRUN)/obj/config && source $(RUMPRUN)/obj/config-PATH.sh && \
cd $(GORUMP)/go/src && CGO_ENABLED=0 GOROOT_BOOTSTRAP=$(GOBOOTSTRAP) GOOS=rumprun GOARCH=amd64 ./make.bash && cd $(GOBASE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a problem for this PR, but in future for aarch64, we should make GOARCH a variable. We can open an issue for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, didn't notice that. Was grepping for x86, will look for amd64 as well. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating an issue to discuss the proper way of having multiple archs

cp -r $(GORUMP)/go1.5 gorump
cp $(GORUMP)/go1.5/bin/go go
cp -r $(RUMPRUN) rumprun-solo5
touch $@

build_docker: submodule_warning $(FILES) gorump
sudo docker build -f Dockerfile -t nabla-go-base .
cp -r $(RUMPRUN) rumprun-solo5
sudo docker build --build-arg host_rumproot=$(realpath ../rumprun) -f Dockerfile -t nabla-go-base .
sudo docker tag nabla-go-base nablact/nabla-go-base
rm -rf gobootstrap gorump rumprun-solo5

clean:
rm -rf gobootstrap gorump rumprun-solo5
rm -rf gobootstrap gorump rumprun-solo5 *_stamp

distclean: clean solo5-clean rumprun-clean
distclean: clean rumprun-clean
8 changes: 4 additions & 4 deletions go-base/Makefile.goapp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
seccomp: goapp.seccomp
spt: goapp.spt

goapp.a: $(wildcard *.go)
go build -buildmode=c-archive -v -a -x

goapp.pseudo: goapp.a
RUMPRUN_STUBLINK=succeed x86_64-rumprun-netbsd-gcc -g -o goapp.pseudo _gorump_main.c goapp.a

goapp.seccomp: goapp.pseudo
rumprun-bake solo5_ukvm_seccomp goapp.seccomp goapp.pseudo
goapp.spt: goapp.pseudo
rumprun-bake solo5_spt goapp.spt goapp.pseudo

%.bin: %.pseudo
rumprun-bake hw_virtio $@ $<

clean:
rm -f goapp.a goapp.h goapp.seccomp goapp.pseudo _gorump_main.c gomaincaller.go
rm -f goapp.a goapp.h goapp.spt goapp.pseudo _gorump_main.c gomaincaller.go
1 change: 1 addition & 0 deletions nginx-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM scratch

COPY rootfs/etc /etc
COPY nginx.nabla /nginx.nabla
COPY data /data

9 changes: 5 additions & 4 deletions nginx-base/Makefile
Original file line number Diff line number Diff line change
@@ -34,10 +34,11 @@ Dockerfile \
Makefile \

.PHONY: rumprun-packages-nginx
rumprun-packages-nginx: rumprun solo5 FORCE
rumprun-packages-nginx: rumprun FORCE
install -m 664 -D $(RUMPPKGS)/config.mk.dist $(RUMPPKGS)/config.mk
source $(RUMPRUN)/obj/config-PATH.sh && make -C $(RUMPPKGS)/nginx all bin/nginx.seccomp
install -m 775 -D $(RUMPPKGS)/nginx/bin/nginx.seccomp nginx.nabla
source $(RUMPRUN)/obj/config && source $(RUMPRUN)/obj/config-PATH.sh && \
make -C $(RUMPPKGS)/nginx all bin/nginx.spt
install -m 775 -D $(RUMPPKGS)/nginx/bin/nginx.spt nginx.nabla

rumprun-packages-nginx-clean:
make -C $(RUMPPKGS)/nginx clean
@@ -49,4 +50,4 @@ build_docker: submodule_warning $(FILES) rumprun-packages-nginx
clean:
rm -rf nginx.nabla

distclean: clean rumprun-packages-nginx-clean solo5-clean rumprun-clean
distclean: clean rumprun-packages-nginx-clean rumprun-clean
2 changes: 1 addition & 1 deletion nginx-base/data/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/null;
access_log /tmp/log;

server {
listen 80;
1 change: 1 addition & 0 deletions nginx-base/rootfs/etc/group
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
daemon:x:1:
2 changes: 2 additions & 0 deletions nginx-base/rootfs/etc/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
127.0.0.1 localhost localhost.
:1 localhost localhost.
2 changes: 2 additions & 0 deletions nginx-base/rootfs/etc/master.passwd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
root:*:0:0::0:0:Charlie &:/:/thereisnoshell
daemon:*:1:1::0:0:The devil himself:/:/thereisnoshell
29 changes: 29 additions & 0 deletions nginx-base/rootfs/etc/nsswitch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# $NetBSD: nsswitch.conf,v 1.6 2009/10/25 00:17:06 tsarna Exp $
#
# nsswitch.conf(5) -
# name service switch configuration file
#


# These are the defaults in libc
#
group: compat
group_compat: nis
hosts: files dns
netgroup: files [notfound=return] nis
networks: files
passwd: compat
passwd_compat: nis
shells: files


# List of supported sources for each database
#
# group: compat, dns, files, nis
# group_compat: dns, nis
# hosts: dns, files, nis, mdnsd, multicast_dns
# netgroup: files, nis
# networks: dns, files, nis
# passwd: compat, dns, files, nis
# passwd_compat: dns, nis
# shells: dns, files, nis
Loading