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

Updated install.sh to include iptables #237

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

rvramesh
Copy link
Contributor

@rvramesh rvramesh commented Jan 19, 2022

Description

iptables dependency is required for debian bullseye support

Motivation and Context

How Has This Been Tested?

Tested with Raspberry Pi 3 1GB Ram, Running latest Debian bullseye

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.

@derek
Copy link

derek bot commented Jan 19, 2022

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "[email protected]"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

1 similar comment
@derek
Copy link

derek bot commented Jan 19, 2022

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "[email protected]"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

@rvramesh rvramesh force-pushed the #227-debian-bullseye-support branch from e2379ea to 4d7dc62 Compare January 19, 2022 14:31
@derek derek bot removed the no-dco label Jan 19, 2022
iptables dependency is required for debian bullseye support

Signed-off-by: Ramesh Vijayaraghavan <[email protected]>
@alexellis
Copy link
Member

@rvramesh @jsiebens what happens on Ubuntu 20.x where you force it to install iptables, despite it being there already? Is there a package for iptables?

What I'm asking is - if in fixing Bullseye / Raspberry Pi, do we break anything for the more common case of Ubuntu?

@rvramesh
Copy link
Contributor Author

@rvramesh @jsiebens what happens on Ubuntu 20.x where you force it to install iptables, despite it being there already? Is there a package for iptables?

What I'm asking is - if in fixing Bullseye / Raspberry Pi, do we break anything for the more common case of Ubuntu?

Great point. My assumption is that apt install iptables will cause nothing or update to latest version for that OS. I don't have a ubuntu setup to validate it though.

@rvramesh
Copy link
Contributor Author

rvramesh commented Jan 20, 2022

@rvramesh @jsiebens what happens on Ubuntu 20.x where you force it to install iptables, despite it being there already? Is there a package for iptables?

  1. When we install a package which is already installed, it will skip or will get upgraded (https://askubuntu.com/questions/1068331/what-will-happen-if-i-install-the-same-package-twice-for-example-the-ubuntu-des)
  2. The ubuntu repository contains the package for iptables https://packages.ubuntu.com/search?keywords=iptables

@alexellis
Copy link
Member

I don't have a ubuntu setup to validate it though.

I can't see how that would be a problem because anyone can create an Ubuntu VM with multipass or by launching a droplet on DigitalOcean or a similar cloud.

This should take you less than 5-10 minutes to verify.

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.

See comments.

@rvramesh rvramesh requested a review from alexellis January 21, 2022 15:53
@rvramesh
Copy link
Contributor Author

rvramesh commented Jan 21, 2022

Hi @alexellis Thank you for the comments. I have resolved them. I am getting the changes tested in Ubuntu 20.04 LTS. Will keep this thread updated on the result.

@rvramesh
Copy link
Contributor Author

Hi @alexellis in the install.sh at line 15 curl is used to fetch the version and display it. In the Ubuntu 20.04 LTS, i had to install it before running the script else it failed. Once curl is installed then the entire installation went smooth.

Question

Can the below code be moved into install_faasd method?

version=""

echo "Finding latest version from GitHub"
version=$(curl -sI https://github.com/$OWNER/$REPO/releases/latest | grep -i "location:" | awk -F"/" '{ printf "%s", $NF }' | tr -d '\r')
echo "$version"

if [ ! $version ]; then
  echo "Failed while attempting to get latest version"
  exit 1
fi

@alexellis
Copy link
Member

Can the below code be moved into install_faasd method?

I need some context to understand why you're asking to do this? What's the benefit, what's the fix?

If curl needs to be added, then let's make sure that gets added early on with apt.

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.

Approved.

@alexellis alexellis merged commit ab47082 into openfaas:master Feb 21, 2022
@alexellis
Copy link
Member

It seems like we already add curl in the script?

@rvramesh
Copy link
Contributor Author

It seems like we already add curl in the script?

At Line 15 the curl is used to fetch the version details. At line 201 the call to install the dependency happens. Hence curl is used before we would install the required dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants