tradle / lambda-plugins

Loader for additional npm packages based on configuration in lamdba function.
MIT License
0 stars 0 forks source link

Add util to publish plugin s3 bucket #5

Closed martinheidegger closed 2 years ago

martinheidegger commented 2 years ago

In order to satisfy the deploy process we need to have the plugin on an accessible storage. Most commonly this will be on s3. It will be necessary for plugins to be deployed on s3 and instead of implementing a script for every case separately it will be good to have a tool/script that allows to simply deploy to a bucket.

urbien commented 2 years ago
urbien commented 2 years ago

^^ runtime: alternatively, each plugin could be in a private github repo, with the tarball as a build artifact in the Github release. Myclouds would have a github token configured per plugin in bot.json

martinheidegger commented 2 years ago

Hosting private plugins on github will alert github/microsoft of the services running on AWS. Having the .tgz files on s3 will be quicker (if same datacenter as lambdas) and more secure. Any http deploytarget should go but reading through the sourcecode I fear I should make it a little more flexible to work as expected. I will add some implementation tomorrow to add this.

martinheidegger commented 2 years ago

This issue was closed with https://github.com/tradle/lambda-plugins/commit/01ab098c98d9c53d777e67afee7fa7a162a3804e

urbien commented 2 years ago

Sequence is like this:

  1. publish plugin somewhere (github or Tradle's s3 bucket or customer's s3 bucket)
  2. have MyCloud load from that external source to its own place (its own s3 or directly to /tmp)

prereqs:

  1. for that external storage, the requesting mycloud will need permissions.
  2. it will need to get some alert to know the URL to download from, maybe even headers for that request. Alternatively, if it is polling, it will need to have a stable URL of the directory, which will contain all releases, and an API to list files / objects in this directory. S3 has such API (list), github may or may not.