Move faas-containerd to faasd-provider unit file

The new unit file runs the merged faasd binary and the provider
command. The install script also prints out a sample login
command to make it easier to use the faas-cli.

Travis / CI has been updated to run the new steps in the e2e
tests.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2020-01-21 13:30:33 +00:00
committed by Alex Ellis
parent d551721649
commit bacf8ebad5
4 changed files with 16 additions and 23 deletions

View File

@ -19,7 +19,7 @@ var installCmd = &cobra.Command{
}
const faasdwd = "/run/faasd"
const faasContainerdwd = "/run/faas-containerd"
const faasdProviderWd = "/run/faasd-provider"
func runInstall(_ *cobra.Command, _ []string) error {
@ -27,7 +27,7 @@ func runInstall(_ *cobra.Command, _ []string) error {
return err
}
if err := ensureWorkingDir(faasContainerdwd); err != nil {
if err := ensureWorkingDir(faasdProviderWd); err != nil {
return err
}
@ -43,18 +43,13 @@ func runInstall(_ *cobra.Command, _ []string) error {
return err
}
err := binExists("/usr/local/bin/", "faas-containerd")
err := binExists("/usr/local/bin/", "faasd")
if err != nil {
return err
}
err = binExists("/usr/local/bin/", "faasd")
if err != nil {
return err
}
err = systemd.InstallUnit("faas-containerd", map[string]string{
"Cwd": faasContainerdwd,
err = systemd.InstallUnit("faasd-provider", map[string]string{
"Cwd": faasdProviderWd,
"SecretMountPath": path.Join(faasdwd, "secrets")})
if err != nil {
@ -71,7 +66,7 @@ func runInstall(_ *cobra.Command, _ []string) error {
return err
}
err = systemd.Enable("faas-containerd")
err = systemd.Enable("faasd-provider")
if err != nil {
return err
}
@ -81,7 +76,7 @@ func runInstall(_ *cobra.Command, _ []string) error {
return err
}
err = systemd.Start("faas-containerd")
err = systemd.Start("faasd-provider")
if err != nil {
return err
}
@ -91,6 +86,9 @@ func runInstall(_ *cobra.Command, _ []string) error {
return err
}
fmt.Println(`Login with:
sudo cat /run/faasd/secrets/basic-auth-password | faas-cli login -s`)
return nil
}