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

fix source for s3 (fixes #3) #4

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c2c1e3f
fix source for s3
ComputerOnFire Aug 5, 2020
0152e6e
fix source for s3
ComputerOnFire Aug 5, 2020
de3386c
fix target for s3 experiment
ComputerOnFire Aug 6, 2020
7d2e483
mirrordirector, revert after build
ComputerOnFire Aug 6, 2020
5aefbd0
mirrordirector, revert after build
ComputerOnFire Aug 6, 2020
6761cf3
mirrordirector, revert after build
ComputerOnFire Aug 6, 2020
84914ca
mirrordirector, revert after build
ComputerOnFire Aug 6, 2020
43b678c
mirrordirector url fix
ComputerOnFire Aug 6, 2020
ff66d2a
revert mirrors before script 50
ComputerOnFire Aug 6, 2020
4a52cf3
use mirrordirector, berkeley commented
ComputerOnFire Aug 6, 2020
8640fc1
balena arm64
ComputerOnFire Aug 6, 2020
14c9467
berkeley mirrors, remove mirrordirector
ComputerOnFire Aug 6, 2020
6b29b4e
re-arrange deployment
ComputerOnFire Aug 6, 2020
ac002f4
first trial
ComputerOnFire Aug 6, 2020
2e0822e
comments
ComputerOnFire Aug 6, 2020
c31ebb8
fix install directory
ComputerOnFire Aug 8, 2020
52e56fa
fix install directory, remove old install folder
ComputerOnFire Aug 8, 2020
f07f976
Merge branch 'drone-dockenson' into drone-test
ComputerOnFire Aug 8, 2020
48d9051
merge balena scripts
ComputerOnFire Aug 8, 2020
acf63d5
fix link
ComputerOnFire Aug 8, 2020
7a31acf
fix deploy
ComputerOnFire Aug 8, 2020
4ba6f4b
fix link
ComputerOnFire Aug 8, 2020
008cc09
revert to old install folder
ComputerOnFire Aug 8, 2020
9e48e24
revert to old install folder
ComputerOnFire Aug 8, 2020
4218e33
revert to old install folder, chmod install script
ComputerOnFire Aug 8, 2020
6a5dfb0
fix deploy oopsie
ComputerOnFire Aug 8, 2020
1ec2445
try planet
ComputerOnFire Aug 8, 2020
3c349fc
netcat-openbsd
ComputerOnFire Aug 8, 2020
1209971
cleanup
ComputerOnFire Aug 9, 2020
a2b6675
cleanup, cancel planet
ComputerOnFire Aug 9, 2020
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
147 changes: 28 additions & 119 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ platform:

steps:
- name: build
image: balenalib/armv7hf-golang
image: johndockenson/runner-armhf
volumes:
- name: dockersock
path: /var/run/docker.sock
Expand All @@ -19,21 +19,12 @@ steps:
- git fetch --tags
- df -h
- losetup -a
- apt-get update
- apt-get dist-upgrade -y
- apt-get install kpartx parted wget curl jq aria2 unzip python3 python3-pip qemu-user-static dmsetup g++-arm-linux-gnueabihf nodejs npm git apt-transport-https ca-certificates gnupg-agent software-properties-common -y
- curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
- apt-key fingerprint 0EBFCD88
- add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
- apt-get update
- apt-get install docker-ce -y
- python3 -m pip install requests
- dmsetup remove_all
- losetup -D
- bash -c 'export GITHUB_KEY="$GITHUB_KEY";mkdir images && PATH=./node_modules/.bin:$PATH ./builder --noninteractive --armhf' # --arm64 or --armhf, need to implement in builder

- name: deploy-experiment
image: balenalib/armv7hf-golang
- name: deploy
image: johndockenson/runner-armhf
volumes:
- name: dockersock
path: /var/run/docker.sock
Expand All @@ -43,81 +34,51 @@ steps:
privileged: true
commands:
- pwd
- apt-get update
- apt-get install rsync git ssh -y
#- git fetch --tags
- echo "$ssh_deploy_key" | base64 --decode --ignore-garbage > .drone/id_deploy
- .drone/environment.sh
- echo "$experiment"
- echo "$image_path"
- .drone/compress.sh
- .drone/compress.sh #split these steps!
- .drone/upload.sh
when:
branch:
exclude:
- master
event:
include:
- tag

- name: s3-experiment
- name: s3-master
image: plugins/s3
settings:
bucket: treehouses
access_key:
from_secret: aws_id
secret_key:
from_secret: aws_secret
source: /**/build/* # build/*
target: / #strip_prefix: build/
when:
branch:
exclude:
- master
event:
include:
- tag

- name: deploy-master
image: balenalib/armv7hf-golang
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
ssh_deploy_key:
from_secret: ssh_secret
privileged: true
commands:
- pwd
- apt-get update
- apt-get install rsync git ssh -y
#- git fetch --tags
- echo "$ssh_deploy_key" | base64 --decode --ignore-garbage > .drone/id_deploy
- .drone/environment.sh
- echo "$experiment"
- echo "$image_path"
- .drone/compress.sh
- .drone/upload.sh
source: build/*
strip_prefix: build/
target: /
when:
branch:
- master
event:
include:
- tag

- name: s3-master
- name: s3-experiment
image: plugins/s3
settings:
bucket: treehouses
access_key:
from_secret: aws_id
secret_key:
from_secret: aws_secret
source: /**/build/* # build/*
target: / #strip_prefix: build/
source: build/*
strip_prefix: build/
target: experiment
when:
branch:
- master
exclude:
- master
event:
include:
- tag
Expand All @@ -137,7 +98,7 @@ platform:

steps:
- name: build
image: balenalib/aarch64-golang
image: johndockenson/runner-arm64
volumes:
- name: dockersock
path: /var/run/docker.sock
Expand All @@ -149,21 +110,12 @@ steps:
- git fetch --tags
- df -h
- losetup -a
- apt-get update
- apt-get dist-upgrade -y
- apt-get install kpartx parted wget curl jq aria2 unzip python3 python3-pip qemu-user-static dmsetup g++-aarch64-linux-gnu nodejs npm git apt-transport-https ca-certificates gnupg-agent software-properties-common -y
- curl -fsSL https://download.docker.com/linux/debian/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 docker-ce -y
- python3 -m pip install requests
- dmsetup remove_all
- losetup -D
- bash -c 'export GITHUB_KEY="$GITHUB_KEY";mkdir images && PATH=./node_modules/.bin:$PATH ./builder --noninteractive --arm64'

- name: deploy-experiment
image: balenalib/aarch64-golang
- name: deploy
image: johndockenson/runner-arm64
volumes:
- name: dockersock
path: /var/run/docker.sock
Expand All @@ -173,81 +125,51 @@ steps:
privileged: true
commands:
- pwd
- apt-get update
- apt-get install rsync git ssh -y
#- git fetch --tags
- echo "$ssh_deploy_key" | base64 --decode --ignore-garbage > .drone/id_deploy
- .drone/environment.sh
- echo "$experiment"
- echo "$image_path"
- .drone/compress.sh
- .drone/compress.sh #split these steps!
- .drone/upload.sh
when:
branch:
exclude:
- master
event:
include:
- tag

- name: s3-experiment
- name: s3-master
image: plugins/s3
settings:
bucket: treehouses
access_key:
from_secret: aws_id
secret_key:
from_secret: aws_secret
source: /**/build/* # build/*
target: / #strip_prefix: build/
when:
branch:
exclude:
- master
event:
include:
- tag

- name: deploy-master
image: balenalib/aarch64-golang
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
ssh_deploy_key:
from_secret: ssh_secret
privileged: true
commands:
- pwd
- apt-get update
- apt-get install rsync git ssh -y
#- git fetch --tags
- echo "$ssh_deploy_key" | base64 --decode --ignore-garbage > .drone/id_deploy
- .drone/environment.sh
- echo "$experiment"
- echo "$image_path"
- .drone/compress.sh
- .drone/upload.sh
source: build/*
strip_prefix: build/
target: /
when:
branch:
- master
event:
include:
- tag

- name: s3-master
- name: s3-experiment
image: plugins/s3
settings:
bucket: treehouses
access_key:
from_secret: aws_id
secret_key:
from_secret: aws_secret
source: /**/build/* # build/*
target: / #strip_prefix: build/
source: build/*
strip_prefix: build/
target: experiment
when:
branch:
- master
exclude:
- master
event:
include:
- tag
Expand All @@ -256,19 +178,6 @@ volumes:
- name: dockersock
host:
path: /var/run/docker.sock

#AWS STUFF HERE
# steps:
# - name: upload
# image: plugins/s3
# settings:
# bucket: my-bucket-name
# access_key:
# from_secret: aws_access_key_id
# secret_key:
# from_secret: aws_secret_access_key
# source: public/**/*
# target: /target/location

---
kind: secret
Expand Down
25 changes: 25 additions & 0 deletions install/etc/install/etc/rc.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi

if [ -f "/etc/tunnel" ];
then
/etc/tunnel
fi

exit 0
12 changes: 12 additions & 0 deletions install/etc/install/etc/systemd/system/autorun.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=run autorun(once)(.sh) scripts from USB stick or in /boot
After=local_fs.target remote_fs.target network-online.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/do_autorun start
Restart=no

[Install]
WantedBy=multi-user.target
34 changes: 34 additions & 0 deletions install/etc/install/etc/systemd/system/balena.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[Unit]
Description=Balena Application Container Engine
Documentation=https://www.balena.io/engine/
After=network-online.target balena.socket firewalld.service
Wants=network-online.target
Requires=balena.socket

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by balena
ExecStart=/usr/bin/balena-engine-daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/balena-engine.sock
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of balena containers
Delegate=yes
# kill only the balena process, not all processes in the cgroup
KillMode=process
# restart the balena process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target
12 changes: 12 additions & 0 deletions install/etc/install/etc/systemd/system/balena.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Balena Socket for the API
PartOf=balena.service

[Socket]
ListenStream=/var/run/balena.sock
SocketMode=0660
SocketUser=root
SocketGroup=balena

[Install]
WantedBy=sockets.target
1 change: 1 addition & 0 deletions scripts.d/16_pkg_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ INSTALL_PACKAGES=(
libhdf5-dev libatlas-base-dev libqt4-test # opencv libjasper1
imagemagick # tiv
python3-bcrypt python3-nacl # fix slow pip
netcat-openbsd # ssh
)

ARMHF_PACKAGES=( #packages which do not work on arm64
Expand Down
Loading