aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Publish V2 as a Ubuntu PPA or Ubuntu Snap

Open GauntletWizard opened this issue 3 years ago • 61 comments

Is your feature request related to a problem? Please describe. The current recommended instructions for installing the AWS CLI V2 involve downloading a zip file, unzipping it, and installing it. This seems to be limited, lacking features like bash-completion that are included with the ubuntu-provided awscli package.

Describe the solution you'd like A package on Ubuntu's PPA, or other Debian package repository, that provides an awscli package and python3-botocore package compatible with the existing awscli packages in the ubuntu repositories.

Describe alternatives you've considered PyPi support has been officially discontinued, and the official docker image provides a number of problems around privileges and credentials communication.

Additional context AWSCLI v1 PPA Apparently unofficial AWSCLI v1 Snap - Well out of date, currently aws-cli/1.15.58

GauntletWizard avatar Mar 11 '21 00:03 GauntletWizard

Hi @GauntletWizard, thanks for the feature request.

Per this comment (https://github.com/aws/aws-cli/issues/4947#issuecomment-793192340), after a source distribution is made available, support for distribution methods will be discussed with the community.

I'm going to leave this issue open and mark the requests for v1 snap as duplicates and close them - I imagine going forward a CLI V1 Snap would not be prioritized.

kdaily avatar Mar 11 '21 17:03 kdaily

I didn't understand why you close my issues and my PRs. #7177

I successful compile aws-cli 2 on snap package for arm. I can share it with you, also make a package here on the repo. Also make it for the ci.

talregev avatar Aug 12 '22 08:08 talregev

I will put my PRs to reference to whom who want to build the snap package. https://github.com/aws/aws-cli/pull/7179 https://github.com/aws/aws-cli/pull/7180

talregev avatar Aug 12 '22 13:08 talregev

Hey in this comment It''s said "In Q2, we plan to begin work on a source bundle that is well documented, easily ingestible by package managers" it's been 19 months now since this comment. Is there any progress in that sense? I don't see many package managers that's able to install v2.

zekena2 avatar Oct 27 '22 18:10 zekena2

Insane that Amazon is still distributing zip files and expecting people to run scripts as root to install their software.

Where is the PPA?

sqrammi avatar Nov 01 '22 20:11 sqrammi

expecting people to run scripts as root to install their software.

Technically packages from PPA also run in-package scripts as root to do the installation.

brlin-tw avatar Dec 02 '22 16:12 brlin-tw

@brlin-tw Yes, but they are signed and validated by the OS seamlessly. Heck, I'd even be happy with a snap package that doesn't require root to install software at all.

sqrammi avatar Dec 02 '22 16:12 sqrammi

@brlin-tw Yes, but they are signed and validated by the OS seamlessly.

Fair point.

brlin-tw avatar Dec 02 '22 16:12 brlin-tw

The Snap now exists at https://snapcraft.io/aws-cli in beta channel, see sudo snap install aws-cli --channel=v2/beta

However, it has a bug in its access permissions, it needs to ask for permissions to ~/.aws/cli/cache not just to ~/.aws, otherwise reading/writing the STS assumerole credentials cache fails.

lizthegrey avatar Jan 27 '23 05:01 lizthegrey

Good news! Thank you.

In the meanwhile (until the issue is fixed) the snap could be used in devmode

sudo snap install aws-cli --channel=v2/beta --devmode

giner avatar Jan 27 '23 07:01 giner

I uploaded revisions 177 (ARM) and 178 that will hopefully address the permissions issue in v2.

marrek-az avatar Feb 01 '23 19:02 marrek-az

I uploaded revisions 177 (ARM) and 178 that will hopefully address the permissions issue in v2.

Confirmed working!

lizthegrey avatar Feb 02 '23 00:02 lizthegrey

New 178 version is working fine on Ubuntu 22.04, but I can't figure how to get bash completion for the Snap.

Is it working for anyone? :pray:

pdecat avatar Feb 02 '23 09:02 pdecat

We are working on the tab completion issue, and that should be fixed soon. We are also looking into additional issues resulting from strict confinement, and working out the best way to address those. I will update again once we have decided on a course of action.

marrek-az avatar Feb 14 '23 17:02 marrek-az

For those that a snap won't work for, I have https://launchpad.net/~lizthegrey/+archive/ubuntu/misc built with jammy backports of the lunar packages and I do refresh it periodically.

lizthegrey avatar Feb 15 '23 11:02 lizthegrey

Thank you so much @lizthegrey! And completion does work out of the box with that package :tada:

pdecat avatar Feb 15 '23 14:02 pdecat

@lizthegrey Can you also create aws-cli v2 snap into armhf architecture?

talregev avatar Feb 17 '23 23:02 talregev

@lizthegrey There is a bug. I am using aws-cli inside snapcraft build. It install, but when I run it, it have runtime error: on core22. It mean ubuntu 22.04 on x64 architecture.

    build-snaps:
    - aws-cli/v2/beta
:: + aws-cli.aws --version
:: /snap/snapd/x1/usr/lib/snapd/snap-confine: error while loading shared libraries: libudev.so.1: failed to map segment from shared object

talregev avatar Feb 19 '23 07:02 talregev

If someone want to compile it for arm:

sudo apt install libffi-dev python3-pip python3-dev musl-dev rustc cargo libssl-dev asn1c libsystemd-dev cmake -y
mkdir -p $HOME/.cargo 
mount -t tmpfs none $HOME/.cargo
pip install git+https://github.com/aws/[email protected]

talregev avatar Feb 20 '23 00:02 talregev

If someone want to compile it for arm:

sudo apt install libffi-dev python3-pip python3-dev musl-dev rustc cargo libssl-dev asn1c libsystemd-dev cmake -y
mkdir -p $HOME/.cargo 
mount -t tmpfs none $HOME/.cargo
pip install git+https://github.com/aws/[email protected]

Sure I can force an armhf build for PPA (I don't control the snap).

lizthegrey avatar Feb 20 '23 00:02 lizthegrey

If someone want to compile it for arm:

sudo apt install libffi-dev python3-pip python3-dev musl-dev rustc cargo libssl-dev asn1c libsystemd-dev cmake -y
mkdir -p $HOME/.cargo 
mount -t tmpfs none $HOME/.cargo
pip install git+https://github.com/aws/[email protected]

Sure I can force an armhf build for PPA (I don't control the snap).

That will be helpful too!

talregev avatar Feb 20 '23 00:02 talregev

The snap is available for the AWS Graviton ARM architecture. I will look at the libudev.so.1 issue.

marrek-az avatar Feb 20 '23 14:02 marrek-az

The snap is available for the AWS Graviton ARM architecture. I will look at the libudev.so.1 issue.

What do you mean by Graviton ARM architecture? As I see in the https://snapcraft.io/aws-cli Only amd64 and arm64. No armhf

image

talregev avatar Feb 20 '23 14:02 talregev

The ARM64 snap will install on Graviton instances. At present, we're not set up to build armhf packages. I can discuss that with the team, but there are a few other snap-related issues I need to address first.

marrek-az avatar Feb 20 '23 15:02 marrek-az

The ARM64 snap will install on Graviton instances. At present, we're not set up to build armhf packages. I can discuss that with the team, but there are a few other snap-related issues I need to address first.

Thank you!

talregev avatar Feb 20 '23 15:02 talregev

@lizthegrey There is a bug. I am using aws-cli inside snapcraft build. It install, but when I run it, it have runtime error: on core22. It mean ubuntu 22.04 on x64 architecture.

    build-snaps:
    - aws-cli/v2/beta
:: + aws-cli.aws --version
:: /snap/snapd/x1/usr/lib/snapd/snap-confine: error while loading shared libraries: libudev.so.1: failed to map segment from shared object

I am unable to reproduce this. I created a simple snap and included the aws-cli in build-snaps as indicated. I then ran snapcraft build --shell --use-lxd and executed aws-cli.aws --version in the shell. Instead of the error, I see: aws-cli/2.9.19 Python/3.8.10 Linux/5.15.0-1028-aws source/x86_64.ubuntu-core.20 prompt/off. I tested this with core20 and core22, but couldn't reproduce the error.

marrek-az avatar Feb 20 '23 17:02 marrek-az

I did it in github action inside docker:

        docker run \
          --rm \
          --tty \
          --privileged \
          --volume $PWD:/root \
          --workdir /root \
          --platform linux/amd64 \
          diddledani/snapcraft:core22 \
          "snap run snapcraft --verbosity verbose pack --destructive-mode --output tal.snap"

talregev avatar Feb 20 '23 19:02 talregev

@lizthegrey Can you update your ppa and add armhf without wait for the next update?

talregev avatar Feb 21 '23 17:02 talregev

@lizthegrey Can you update your ppa and add armhf without wait for the next update?

yup working on it, just, it's a spare time project, I need to do another upload with a bumped ppa version number since I can't re-upload the same version number.

lizthegrey avatar Feb 22 '23 10:02 lizthegrey

@lizthegrey Can you update your ppa and add armhf without wait for the next update?

yup working on it, just, it's a spare time project, I need to do another upload with a bumped ppa version number since I can't re-upload the same version number.

Thank you!

talregev avatar Feb 22 '23 10:02 talregev