Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alrik11es/metal-functions
A rapid FaaS deployment system for non experts
https://github.com/alrik11es/metal-functions
Last synced: about 1 month ago
JSON representation
A rapid FaaS deployment system for non experts
- Host: GitHub
- URL: https://github.com/alrik11es/metal-functions
- Owner: alrik11es
- License: mit
- Created: 2022-07-20T10:42:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T15:25:45.000Z (about 1 year ago)
- Last Synced: 2024-05-21T05:14:55.839Z (6 months ago)
- Language: PHP
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Metal Functions
A.K.A. MF, a CLI for FaaS like deployment in PHP metal servers for non experts.## Use and intentions
This project aims to deploy multiple different functions in a server with Nginx and PHP. It will create the Nginx virtual hosts just for you. You will only have to know how to use this CLI. A MF could be a directory or a php single file.This project is also compatible with [Deployer](https://deployer.org/) config files, we share some of the libraries so most of the Host configuration is the same.
## MF System requirements
* Any kind of Debian based system should do
* PHP >=8.0 with Nginx
* 512MB RAM## CLI System requirements
* PHP >=8.0## Build from source
Download and decompress this repo on any directory.
```
$ composer install
$ ./mf app:build
$ sudo mv builds/mf /usr/local/bin/mf
```## Install
* In the remote host you need Nginx and PHP 7.4 installed on any host.
* In your system for the CLI, you require SSH access to a server with Nginx and PHP >=7.3.First you will need to install MF.
```
$ wget https://github.com/alrik11es/releases/... (Not yet)
$ sudo mv mf /usr/local/bin/mf
```Download the latest release from releases page.
### ON SERVER (FullStack if needed)
```
$ git clone https://github.com/alrik11es/MetalFunctions.git
$ cd MetalFunctions
$ ./installer.sh
```### Using Metal Functions
Well, supossing that you already have a PHP >=7.3 with Nginx server then you can get MF.First you will need to install MF.
```
$ wget https://github.com/alrik11es/releases/mf.phar
$ sudo mv mf.phar /usr/local/bin/mf
```Create a directory. `$ mkdir hello-world` and create a file called `$ touch metal.php`. This file is going to be your settings file. You can add here the URL of the function and your start script. View the example as follows.
```php
set('remote_user', 'ubuntu')
->set('become', 'root')
->set('identity_file', '~/.ssh/mykey');
```Once you're done you can start using MF commands in the shell.
```
$ echo " helloworld.php
$ mf deploy
... Function name 89x7tya : http://ip/89x7tya
```DONE.
Using my own [Basic library standard](https://www.msfsoftware.com/art%C3%ADculos/basic-library-standard)
## TODO
- [X] Host check for PHP and Nginx
- [X] Host check to enable metal functions in disabling default NGINX file
- [X] Deploy function
- [X] Delete function
- [ ] Docker container
- [ ] List functions
- [ ] Rollback a function