From 5bb7ac45b3cd418c88726bfc575401774788080c Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Sat, 29 Jun 2024 23:16:55 -0300 Subject: [PATCH] Lint/cleanup --- .../function.cr => hello_crystal/funko.cr} | 0 examples/{hello_cr => hello_crystal}/funko.yml | 0 runtimes/crystal/main.cr | 2 +- shard.yml | 5 +---- src/faaso.cr | 15 --------------- 5 files changed, 2 insertions(+), 20 deletions(-) rename examples/{hello_cr/function.cr => hello_crystal/funko.cr} (100%) rename examples/{hello_cr => hello_crystal}/funko.yml (100%) diff --git a/examples/hello_cr/function.cr b/examples/hello_crystal/funko.cr similarity index 100% rename from examples/hello_cr/function.cr rename to examples/hello_crystal/funko.cr diff --git a/examples/hello_cr/funko.yml b/examples/hello_crystal/funko.yml similarity index 100% rename from examples/hello_cr/funko.yml rename to examples/hello_crystal/funko.yml diff --git a/runtimes/crystal/main.cr b/runtimes/crystal/main.cr index 0294940..c8670e8 100644 --- a/runtimes/crystal/main.cr +++ b/runtimes/crystal/main.cr @@ -1,4 +1,4 @@ require "kemal" -require "./function.cr" +require "./funko.cr" Kemal.run diff --git a/shard.yml b/shard.yml index 6ca2c29..89d240e 100644 --- a/shard.yml +++ b/shard.yml @@ -21,8 +21,5 @@ dependencies: branch: add_exposed_ports commander: github: mrrooijen/commander - kiwi: - github: ralsina/kiwi - branch: master kemal: - github: kemalcr/kemal \ No newline at end of file + github: kemalcr/kemal diff --git a/src/faaso.cr b/src/faaso.cr index 310db4c..7dc2032 100644 --- a/src/faaso.cr +++ b/src/faaso.cr @@ -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