Lint/cleanup

This commit is contained in:
Roberto Alsina 2024-06-29 23:16:55 -03:00
parent ce856beaf2
commit 5bb7ac45b3
5 changed files with 2 additions and 20 deletions

View File

@ -1,4 +1,4 @@
require "kemal"
require "./function.cr"
require "./funko.cr"
Kemal.run

View File

@ -21,8 +21,5 @@ dependencies:
branch: add_exposed_ports
commander:
github: mrrooijen/commander
kiwi:
github: ralsina/kiwi
branch: master
kemal:
github: kemalcr/kemal

View File

@ -3,19 +3,12 @@ require "commander"
require "docr"
require "docr/utils.cr"
require "file_utils"
require "kiwi/file_store"
require "uuid"
# FIXME make it configurable
REPO = "localhost:5000"
# Functions as a Service, Ops!
module Faaso
VERSION = "0.1.0"
# A simple persistent k/v store
store = Kiwi::FileStore.new(".kiwi")
# Ensure the faaso-net network exists
def self.setup_network
docker_api = Docr::API.new(Docr::Client.new)
@ -69,11 +62,6 @@ module Faaso
puts "Building function... #{funko.name} in #{tmp_dir}"
slug = funko.name
# FIXME: this should be configurable
repo = REPO
docker_api = Docr::API.new(Docr::Client.new)
docker_api.images.build(
context: tmp_dir.to_s,
@ -94,7 +82,6 @@ module Faaso
def run
funkos = Funko.from_paths(@arguments)
funkos.each do |funko|
repo = REPO
container_name = "faaso-#{funko.name}"
docker_api = Docr::API.new(Docr::Client.new)
# Pull image from registry
@ -188,8 +175,6 @@ module Faaso
next
end
puts "Container for #{funko.name} is running"
public_port = containers[0].@ports[0].@public_port
# TODO: Map route in reverse proxy to function
end
# TODO: Run test for healthcheck
# TODO: Return function URL for testing