Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system install using arkade #261

Merged
merged 1 commit into from
May 30, 2022

Conversation

nitishkumar71
Copy link
Member

@nitishkumar71 nitishkumar71 commented Apr 14, 2022

Signed-off-by: Nitishkumar Singh [email protected]

Arkade will be used to install system packages cni and containerd

Description

Motivation and Context

How Has This Been Tested?

  1. The script ./hack/install.sh is being used to do a complete installation of faasd.
  2. List Namespace using faas-cli namespaces which will produce output
Namespaces:
 - openfaas-fn
  1. deploy function using command faas-cli store deploy figlet
Deployed. 200 OK.
URL: http://127.0.0.1:8080/function/figlet
  1. Invoke function using command uname | faas-cli invoke figlet. Output printed successfully.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Commits:

  • I've read the CONTRIBUTION guide
  • My commit message has a body and describe how this was tested and why it is required.
  • I have signed-off my commits with git commit -s for the Developer Certificate of Origin (DCO)

Code:

  • My code follows the code style of this project.
  • I have added tests to cover my changes.

Docs:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

$SUDO systemctl unmask containerd || :
$SUDO curl -SLfs https://raw.githubusercontent.com/containerd/containerd/v${CONTAINERD_VER}/containerd.service --output /etc/systemd/system/containerd.service
$SUDO systemctl enable containerd
$SUDO systemctl start containerd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think we'll also want to keep the start command which arkade doesn't do at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No We don't need that. In local test on multipass containerd start after installation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just add the --systemd flag to make it explicit then when people come back to do a diff later if there's ever a problem, it will help understand the change.

@alexellis
Copy link
Member

Why don't we add faasd to arkade, so that the get.sh script could use arkade to download that too?

@alexellis
Copy link
Member

For testing, could you launch a new multipass VM, and then after it's up - use this script, followed by trying faas-cli login / store deploy and invoke etc.

@nitishkumar71 nitishkumar71 force-pushed the arakde_system_install branch from 235c3f0 to 5ca4595 Compare April 23, 2022 02:17
@nitishkumar71
Copy link
Member Author

For testing, could you launch a new multipass VM, and then after it's up - use this script, followed by trying faas-cli login / store deploy and invoke etc.

I had done that but forgot to add steps into PR. Added them now.

@nitishkumar71
Copy link
Member Author

Why don't we add faasd to arkade, so that the get.sh script could use arkade to download that too?
I can start doing it. Once it's done, I can create a new PR with changes into it.

@nitishkumar71 nitishkumar71 requested a review from alexellis April 23, 2022 05:11
@welteki
Copy link
Member

welteki commented Apr 29, 2022

Tested this on a pi3 running the latest Raspberry Pi OS Lite (64-bit).

Screenshot 2022-04-28 at 15 35 44

Works as expected.

hack/install.sh Outdated
@@ -194,7 +161,8 @@ EOF
}

install_faas_cli() {
curl -sLS https://cli.openfaas.com | $SUDO sh
arkade get faas-cli
$SUDO mv $HOME/.arkade/bin/faas-cli /usr/local/bin/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will also need to chmod every binary so that the world can read and execute.

chmod o+rx /usr/local/bin/faas-cli

# or

chmod 755 /usr/local/bin/faas-cli

The install command can also do this in one line:

$SUDO install -m 755 $HOME/.arkade/bin/faas-cli /usr/local/bin/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, but I'd like us to get Caddy into arkade before we merge it.

Can you take that?

We also need to chmod executable files so regular users can execute them, so I suggested using the install command

@alexellis
Copy link
Member

@welteki thanks for running through that for us.

What permission do you see for? ls -l /usr/local/bin/faas-cli

@alexellis alexellis changed the title system install using arakde system install using arkade May 4, 2022
@alexellis
Copy link
Member

@nitishkumar71 caddy is now available in arkade, if you're able to update the script?

@nitishkumar71 nitishkumar71 force-pushed the arakde_system_install branch 2 times, most recently from 7576baa to 00d9d1e Compare May 13, 2022 17:45
@nitishkumar71
Copy link
Member Author

nitishkumar71 commented May 13, 2022

@nitishkumar71 caddy is now available in arkade, if you're able to update the script?

Ahh! I was working to setup it as system install, which is quite tricky.

I have updated the code to use get for caddy.

@nitishkumar71 nitishkumar71 requested a review from alexellis May 13, 2022 17:47
hack/install.sh Outdated
curl -sSL "https://github.com/caddyserver/caddy/releases/download/v2.4.3/caddy_2.4.3_linux_${suffix}.tar.gz" | $SUDO tar -xvz -C /usr/bin/ caddy
CADDY_VER=v2.4.3
arkade get caddy -v ${CADDY_VER}
$SUDO install -m 755 $HOME/.arkade/bin/faas-cli /usr/local/bin/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You install the faas-cli instead of caddy.
The systemd file expects caddy to be in /usr/bin not /usr/local/bin/

Suggested change
$SUDO install -m 755 $HOME/.arkade/bin/faas-cli /usr/local/bin/
$SUDO install -m 755 $HOME/.arkade/bin/caddy /usr/bin/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, possibly missed to save. As i have tested the script code into multipass installation. Have corrected it.

@welteki
Copy link
Member

welteki commented May 16, 2022

Tested successfully on:

  • Raspberry Pi OS Lite (64-bit)
  • Debian 11
  • Ubuntu 22.04

On CentOS 9 I run into an issue similar to alexellis/arkade#683, alexellis/arkade#685.

When running arkade commands with sudo the arkade binary is not found because /usr/local/bin is not included in the PATH.

@nitishkumar71 nitishkumar71 force-pushed the arakde_system_install branch from 00d9d1e to 86ec744 Compare May 17, 2022 02:19
Signed-off-by: Nitishkumar Singh <[email protected]>

install faas-cli using arkade

Signed-off-by: Nitishkumar Singh <[email protected]>

caddy installation moved to arkade

Signed-off-by: Nitishkumar Singh <[email protected]>

corrected caddy cli name

Signed-off-by: Nitishkumar Singh <[email protected]>
@nitishkumar71 nitishkumar71 force-pushed the arakde_system_install branch from 86ec744 to 4a1c60a Compare May 25, 2022 13:56
@alexellis
Copy link
Member

From @welteki sounds like we may need a slight change for CentOS users because /usr/local/bin isn't in the path of the sudo user.

I suggested trying out this in the script:

export PATH=$PATH:/usr/local/bin/

$SUDO -e arkade .. 

Otherwise?

export ARKADE=/usr/local/bin/arkade

$SUDO -e $ARKADE install

See also: alexellis/arkade@613830d

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge this, @welteki is going to send a PR following on from this with changes for CentOS.

@alexellis alexellis merged commit a88997e into openfaas:master May 30, 2022
@welteki welteki mentioned this pull request May 30, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert hack/install.sh to use arkade for system packages
3 participants