Compare commits

...

8 Commits

Author SHA1 Message Date
379b4e2472 No need to filter containers here 2024-07-08 07:18:27 -03:00
7104403585 todo management 2024-07-08 07:16:51 -03:00
47fcdda2d4 todo management 2024-07-08 07:13:46 -03:00
68c9960a58 Fix log 2024-07-07 21:50:41 -03:00
52e461ec80 Save a little space in the final image 2024-07-07 21:50:10 -03:00
bcbf74bbaa Update example funko 2024-07-07 21:49:52 -03:00
bbe934f2b8 todo management 2024-07-07 21:49:21 -03:00
8228ea3233 todo management 2024-07-07 21:19:00 -03:00
8 changed files with 43 additions and 8 deletions

View File

@ -22,13 +22,17 @@
* ✅ Make server take options from file
* ✅ Make server take options from environment
* ✅ Make server password configurable
* admin/admin auth client side
* admin/admin auth client side [WIP, broke everything]
* `faaso login` is not working properly yet with proxy
* CD for binaries and images for at least arm64/x86
* Multi-container docker logs [faaso logs -f FUNKO]
* ✅ Direct error and above to stderr, others to stdout,
while keeping logging level configurable
* ✅ Fix proxy reload / Make it reload on file changes
* Implement `faaso help command`
* Fix `export examples/hello_crystal` it has a `template/`
* Implement zero-downtime rollout
* Cleanup `tmp/` after use unless `DEBUG` is set
# Things to do but not before release

View File

@ -1 +1 @@
password: admin
password: adminfoo

8
config/funkos Normal file
View File

@ -0,0 +1,8 @@
handle_path /faaso/hello/* {
reverse_proxy /* http://faaso-hello-9zth8p:3000 {
health_uri /ping
fail_duration 30s
}
}

View File

@ -1,3 +1,11 @@
# README
# Readme for Hello_crystal
This is the readme for people trying to *use* this runtime.
This is a funko using the Crystal runtime for [FaaSO](https://git.ralsina.me/ralsina/faaso)
## What is Hello_crystal
Write here what it is
## How to use Hello_crystal
And so on.

View File

@ -0,0 +1,14 @@
name: hello_crystal
version: 0.1.0
targets:
funko:
main: main.cr
dependencies:
kemal:
github: kemalcr/kemal
# development_dependencies:
# webmock:
# github: manastech/webmock.cr

View File

@ -10,7 +10,7 @@ RUN shards build --release
RUN strip bin/*
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
RUN apk update && apk upgrade && apk add openssl pcre2 libgcc gc libevent curl {{ ship_packages | join " " }} && apk cache clean
RUN apk update && apk upgrade && apk add pcre2 libgcc gc libevent curl {{ ship_packages | join " " }} && apk cache clean
RUN addgroup -S app && adduser app -S -G app
WORKDIR /home/app
@ -19,4 +19,4 @@ USER app
COPY --from=build /home/app/bin/funko .
CMD ["./funko"]
HEALTHCHECK {{ healthcheck_options }} CMD {{ healthcheck_command }}
HEALTHCHECK {{ healthcheck_options }} CMD {{ healthcheck_command }}

View File

@ -127,7 +127,7 @@ module Funko
# Helper to run faaso locally and respond via env
def run_faaso(args : Array(String), env) : Bool
Log.info { "Running faaso [#{args.join(", ")}, -l]" }
Log.info { "Running faaso [#{args.join(", ")}, -l, 2>&1]" }
Process.run(
command: "faaso",
args: args + ["-l", "2>&1"], # Always local in the server

View File

@ -99,7 +99,8 @@ module Funko
sleep 0.1.seconds
}
else
containers.select { |container| container.@state == "running" }.sort! { |i, j|
# Sort them older to newer, so we stop the oldest
containers.sort! { |i, j|
i.@created <=> j.@created
}.each { |container|
Log.info { "Removing instance" }