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

Build arm32v6 and arm32v7 versions #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
58 changes: 58 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
image: golang:1.10-stretch

variables:
REPO_NAME: github.com/ernoaapa/eliot-os

stages:
- test
- build
- publish

before_script:
- go version
# Move project under $GOPATH
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
# Build tools
- go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit
# - go get -u github.com/estesp/manifest-tool
# - go get -u github.com/tcnksm/ghr
# Ensure jq is installed
- apt-get install -y jq
- echo '{}' | jq '.'
# Configure Docker
- ./build/install-docker.sh
- echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin

test:
stage: test
tags:
- arm64
script:
- cd pkg
- make forcebuild

publish:arm64:
stage: publish
tags:
- arm64
script:
- cd pkg
- GOOS=linux GOARCH=arm64 make forcepush

publish:armv6:
stage: publish
tags:
- armv6
script:
- cd pkg
- GOOS=linux GOARCH=arm GOARM=6 make forcepush

publish:armv7:
stage: publish
tags:
- armv7
script:
- cd pkg
- GOOS=linux GOARCH=arm GOARM=7 make forcepush
21 changes: 21 additions & 0 deletions build/install-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -eu

apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository \
"deb [arch=arm64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"

apt-get update && apt-get install -y docker-ce

echo "Installed docker:"
docker version
3 changes: 2 additions & 1 deletion pkg/rsync/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ image: rsync
gitrepo: https://github.com/ernoaapa/eliot-os
arches:
- arm64
- amd64
- amd64
- arm
119 changes: 119 additions & 0 deletions rpi3-persisted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
kernel:
image: linuxkit/kernel:4.14.27
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:b212cfeb4bb6330e0a7547d8010fe2e8489b677a
- linuxkit/runc:7c39a68490a12cde830e1922f171c451fb08e731
- linuxkit/containerd:37e397ebfc6bd5d8e18695b121166ffd0cbfd9f0
- linuxkit/ca-certificates:v0.2
onboot:
- name: sysctl
image: linuxkit/sysctl:v0.2
- name: netdev
image: linuxkit/modprobe:v0.2
# smsc95xx - https://github.com/linuxkit/linuxkit/blob/master/docs/platform-rpi3.md#networking
# mmc_block - Load MMC block device driver so the sdcard is visible in /dev/mmc*
command: ["modprobe", "-a", "smsc95xx", "mmc_block" ]
- name: extend
# Note: temporarily use ernoaapa/extend to extend the last partition
# See: https://github.com/linuxkit/linuxkit/issues/2971
image: ernoaapa/extend:187548787419ea12ce02025cc50cf6ff5d6bfc7a
command: ["/usr/bin/extend", "/dev/mmcblk0"]
- name: format
image: linuxkit/format:v0.2
command: ["/usr/bin/format", "-force", "-type", "ext4", "-label", "DATA", "-verbose", "/dev/sda"]
- name: mount-disk
image: linuxkit/mount:v0.2
# command: ["/usr/bin/mountie", "/dev/mmcblk0p2", "/var"]
command: ["/usr/bin/mountie", "-device", "/dev/sda1", "/var/foo"]
binds:
- /dev:/dev
- /var:/var:rshared,rbind
- /:/hostroot
- /etc/fstab:/etc/fstab
- /mnt:/mnt
# - name: mount-fstab
# image: linuxkit/mount:v0.2
# binds:
# - "/etc/fstab:/etc/fstab"
# command: ["/bin/mount", "-a", "-v"]
# - name: mount-tmp
# image: linuxkit/mount:v0.2
# command: ["/bin/sh", "-c", "mkdir -p /mnt/tmp && mount --bind /mnt/tmp /tmp"]
# - name: mount-containers
# image: linuxkit/mount:v0.2
# command: ["/bin/sh", "-c", "mkdir -p /mnt/containers && mount --bind /mnt/containers /containers"]
# - name: mount-var
# image: linuxkit/mount:v0.2
# command: ["/bin/sh", "-c", "mkdir -p /mnt/var && mount --bind /mnt/var /var"]
- name: dhcpcd
image: linuxkit/dhcpcd:v0.2
# Halts until dhcpcd can resolve ip address
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]

services:
- name: getty
image: linuxkit/getty:v0.2
env:
# Makes the terminal open without password prompt
- INSECURE=true
binds:
- "/etc/resolv.conf:/etc/resolv.conf"
- "/run:/run"
- "/tmp:/tmp"
- "/etc:/hostroot/etc"
- "/usr/bin/ctr:/usr/bin/ctr"
- "/usr/bin/runc:/usr/bin/runc"
- "/containers:/containers"
- "/var/log:/var/log"
- "/dev:/dev"
- "/sys:/sys"
- "/proc:/hostroot/proc"
- "/var:/var"
- "/var/foo:/var/foo"
- name: ntpd
image: linuxkit/openntpd:v0.2
- name: dhcpcd
image: linuxkit/dhcpcd:v0.2

- name: eliotd
image: ernoaapa/eliotd:v0.2.8
command: ["/eliotd", "--debug", "--profile", "--grpc-api-listen", "0.0.0.0:5000"]
capabilities:
- all
net: host
pid: host
runtime:
mkdir: ["/var/lib/volumes"]
binds:
- /containers:/containers
- /var/lib/volumes:/var/lib/volumes
- /var/lib/containerd:/var/lib/containerd
- /run/containerd:/run/containerd
- /etc/resolv.conf:/etc/resolv.conf
- /etc/machine-id:/etc/machine-id
- /var/log:/var/log # To be able to serve default containers logs through api
- /tmp:/tmp # To be able to read temporary fifo log files
- /run:/run
- /dev:/dev
- /sys:/sys

files:
- path: /etc/issue
contents: "welcome to EliotOS"
- path: /etc/machine-id
contents: "todo-generate"
mode: "0600"
# - path: /etc/fstab
# contents: |
# /mnt/containers /containers bind bind
# /mnt/var/lib /var/lib bind bind
# /mnt/var/log /var/log bind bind
# /mnt/tmp /tmp bind bind
trust:
org:
- linuxkit
# image:
# partitions:
# - { start: 1048576, size: 104857600, boot: true, type: "fat32" } # 100MB partition for boot
# - { start: 105906688, size: 52428800, type: "ext4" } # 50MB partition (get extended on boot) for persisted