Drop docker and woodpecker

main
mat ess 2022-10-10 21:08:00 -04:00
parent a08755200f
commit cac0366a09
10 changed files with 6 additions and 242 deletions

View File

@ -1,14 +0,0 @@
FROM docker:dind
RUN apk add bash ip6tables pigz sysstat procps lsof gcompat
COPY etc/docker/daemon.json /etc/docker/daemon.json
COPY ./entrypoint ./entrypoint
COPY ./docker-entrypoint.d/* ./docker-entrypoint.d/
ENV DOCKER_TMPDIR=/data/docker/tmp
ENTRYPOINT ["./entrypoint"]
CMD ["dockerd", "-p", "/var/run/docker.pid"]

View File

@ -1,26 +0,0 @@
# Fly Docker Daemon
This is a Docker Daemon that runs on Fly.io and can be used to offload builds and other tasks to a Fly app running in a city near you.
## Installation
1. Clone this repository
1. `fly launch`, follow the prompts
1. Select `n` when it asks if you want to deploy
1. Create a volume in a region of your choice: `fly volumes create data --size 50 --region ord`
1. Deploy
## Get Connected
1. Create a WireGuard peer with `fly wireguard create`
1. Setup WireGuard with generated config
1. `fly ips private` to get the IP of your Daemon
1. Set the `DOCKER_HOST` env variable using that IP:
```
export DOCKER_HOST=tcp://[fdaa:0:5d2:a7b:81:0:26d4:2]:2375
```
# Final Step
1. Delete the Docker Engine from your local system.
1. You probably want to scale your remote Daemon: `fly scale vm dedicated-cpu-2x`

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -e
echo "Setting up Docker data directory"
mkdir -p /data/docker
echo "Configuring ipv6 for docker"
ip6tables -t nat -A POSTROUTING -s 2001:db8:1::/64 ! -o docker0 -j MASQUERADE
echo "Done setting up docker!"

View File

@ -1,46 +0,0 @@
#!/bin/bash
set -e
echo "Allowing ipv6 forwarding via sysctl"
sysctl net.ipv6.conf.default.forwarding=1
sysctl net.ipv6.conf.all.forwarding=1
echo "General sysctl tweaks"
sysctl vm.swappiness=0
sysctl vm.dirty_ratio=6
sysctl vm.dirty_background_ratio=3
# Default Socket Receive Buffer
sysctl net.core.rmem_default=31457280
# Maximum Socket Receive Buffer
sysctl net.core.rmem_max=33554432
# Default Socket Send Buffer
sysctl net.core.wmem_default=31457280
# Maximum Socket Send Buffer
sysctl net.core.wmem_max=33554432
# Increase number of incoming connections
sysctl net.core.somaxconn=65535
# Increase number of incoming connections backlog
sysctl net.core.netdev_max_backlog=65536
# Increase the maximum amount of option memory buffers
sysctl net.core.optmem_max=25165824
# Increase the maximum total buffer-space allocatable
# This is measured in units of pages (4096 bytes)
sysctl "net.ipv4.tcp_mem=786432 1048576 26777216"
sysctl "net.ipv4.udp_mem=65536 131072 262144"
# Increase the read-buffer space allocatable
sysctl "net.ipv4.tcp_rmem=8192 87380 33554432"
sysctl net.ipv4.udp_rmem_min=16384
# Increase the write-buffer-space allocatable
sysctl "net.ipv4.tcp_wmem=8192 65536 33554432"
sysctl net.ipv4.udp_wmem_min=16384

View File

@ -1,13 +0,0 @@
#!/bin/bash
set -e
if [[ -d "docker-entrypoint.d" ]]
then
echo "Running docker-entrypoint.d files"
/bin/run-parts docker-entrypoint.d
fi
echo "Running $@"
exec "$@"

View File

@ -1,27 +0,0 @@
{
"data-root": "/data/docker",
"experimental": true,
"ipv6": true,
"ip6tables": true,
"fixed-cidr-v6": "2001:db8:1::/64",
"default-address-pools": [
{
"base": "10.100.0.1/16",
"size": 24
}
],
"debug": true,
"log-level": "debug",
"features": {
"buildkit": false
},
"hosts": [
"unix:///var/run/docker.sock",
"tcp://[::]:2375"
],
"mtu": 1400,
"max-concurrent-downloads": 10,
"max-concurrent-uploads": 5,
"metrics-addr": "0.0.0.0:9323",
"tls": false
}

View File

@ -1,8 +0,0 @@
app = "docker-mat-services"
kill_signal = "SIGINT"
kill_timeout = 5
[[mounts]]
destination = "/data"
source = "docker_data"

View File

@ -52,10 +52,12 @@ http://static-mat-services.fly.dev {
}
# caching
@static {
path *.bmp *.jpg *.png *.svg *.gif *.pdf *.css* *.js *.woff *.woff2 /style/* /font/* /image/*
}
route {
header /style/* Cache-Control max-age=31536000, immutable
header /image/* Cache-Control max-age=31536000, immutable
header /font/* Cache-Control max-age=31536000, immutable
header Cache-Control max-age=180
header @static Cache-Control max-age=31536000, immutable
header *.xml Cache-Control max-age=0
header ?Cache-Control max-age=360
}
}

View File

@ -1,44 +0,0 @@
# fly.toml file generated for woodpecker-agent-mat-services on 2022-08-26T22:45:39-04:00
app = "woodpecker-agent-mat-services"
kill_signal = "SIGINT"
kill_timeout = 5
[build]
image = "woodpeckerci/woodpecker-agent:latest"
[env]
WOODPECKER_SERVER = "woodpecker-mat-services.internal:9000"
WOODPECKER_HOSTNAME = "woodpecker-agent-mat-services"
WOODPECKER_BACKEND = "docker"
DOCKER_HOST = "tcp://[fdaa:0:742b:a7b:ab2:1:9d2b:2]:2375"
[experimental]
allowed_public_ports = []
auto_rollback = true
# [[services]]
# http_checks = []
# internal_port = 8080
# processes = ["app"]
# protocol = "tcp"
# script_checks = []
# [services.concurrency]
# hard_limit = 25
# soft_limit = 20
# type = "connections"
# [[services.ports]]
# force_https = true
# handlers = ["http"]
# port = 80
# [[services.ports]]
# handlers = ["tls", "http"]
# port = 443
# [[services.tcp_checks]]
# grace_period = "1s"
# interval = "15s"
# restart_limit = 0
# timeout = "2s"

View File

@ -1,49 +0,0 @@
# fly.toml file generated for woodpecker-mat-services on 2022-08-26T22:08:48-04:00
app = "woodpecker-mat-services"
kill_signal = "SIGINT"
kill_timeout = 5
[build]
image = "woodpeckerci/woodpecker-server:latest"
[env]
WOODPECKER_GITEA = "true"
WOODPECKER_GITEA_URL = "https://git.mat.services"
WOODPECKER_HOST = "https://build.mat.services"
WOODPECKER_OPEN = "false"
WOODPECKER_ADMIN = "mat,jay"
[experimental]
allowed_public_ports = []
auto_rollback = true
[mounts]
destination = "/var/lib/woodpecker"
source = "woodpecker_data"
[[services]]
http_checks = []
internal_port = 8000
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"