Elastic Beanstalk & Docker - EB CLI Does Not Work on Mac! BUG - macos

When I try and use elastic beanstalk from the command line (ie eb create project) I got the following error.
Select a platform version.
1) Docker 17.03.2-ce
2) Docker 1.12.6
3) Docker 1.11.2
4) Docker 1.9.1
5) Docker 1.7.1
6) Docker 1.6.2
7) Docker 1.5.0
(default is 1): 1
Note: Elastic Beanstalk now supports AWS CodeCommit; a fully-managed source control service. To learn more, see Docs: https://aws.amazon.com/codecommit/
Do you wish to continue with CodeCommit? (y/N) (default is n): n
Do you want to set up SSH for your instances?
(Y/n): y
Select a keypair.
1) patientplatypus
2) phoenixvuenewsly
3) [ Create new KeyPair ]
(default is 2): 1
patientplatypus:~/Documents/newsly_project:11:56:37$eb create newsly_project_production
ERROR: Platform Docker 17.03.2-ce does not appear to be valid
patientplatypus:~/Documents/newsly_project:11:57:44$docker --version
Docker version 17.09.0-ce, build afdb6d4
I thought the above seemed understandable enough, at first. I have version 17.09.0-ce of Docker, but I need version 17.03.2-ce. It would seem reasonable that AWS would be a few versions behind the latest version of Docker if nothing else than to double check system integration and security.
However, when it came time to find version 17.03.2-ce I found it almost impossible. https://github.com/moby/moby/releases points me to 17.03.02-ce as a direct link on the downloads page, which again downloads the wrong version. I tried downloading the link to the static binaries, however that was very confusing. This page https://docs.docker.com/engine/installation/linux/docker-ce/binaries/#next-steps says that in order to get the static binaries to compile I should run the command sudo cp docker/docker /usr/local/bin/, however nowhere in that static binary folder is there a folder labeled docker.
Meanwhile this page https://docs.docker.com/docker-for-mac/release-notes/#docker-community-edition-17090-ce-mac32-2017-10-02-stable, goes from release Docker Community Edition 17.03.1-ce-mac12, 2017-05-12 (stable) to release Docker Community Edition 17.06.0-ce-mac18, 2017-06-28 (stable). Not only does this skip the one release I need, but it seems to have versions that are ahead of the most recent release at https://github.com/moby/moby/releases.
I'm very very confused. It should not be as difficult as this to get the currently stable version of Docker that runs with AWS. Can someone let me know how to resolve this issue?
EDIT:
I spun up my Linux Mint 18 (Ubuntu 16.04) and installed docker to try and get this to work. As it happens linux ALSO installs version Docker version 17.09.0-ce, however this one works with the 1) Docker 17.03.2-ce elastic beanstalk option. All the same commands on a linux environment running the same version of docker now run on eb cli. Therefore I am retitling this post as an EB CLI bug for mac. My question now is, where do I submit a bug report to AWS? I have searched for a github repository for them, but have not found it, and I think that most of their reporting through aws.amazon.com is for enterprise level customers.
Thanks!

Related

bind source path does not exist: /host_mnt

I have a ddev installation on macOS which I used for a while.
ddev 1.16.2
docker 20.10.0
macOS 11.0.1 - Intel
Today I upgraded to docker 20.10.0 and in the process to ddev 1.16.2.
When I start an existing site, that worked all the time I get
Creating ddev-mysite-db ... error
ERROR: for ddev-mysite-db Cannot create container for service db: invalid mount config for type "bind": bind source path does not exist: /host_mnt/Users/me/Documents/Development/WebSite/mysite/.ddev
This started to happen after I upgraded docker from the previous version. Upgrading ddev did not change too much.
Even when I create a new site, the same error message pops up so I am pretty much stuck.
At least for me it looks like the docker 20.10.0 breaks ddev. Any ideas how to deal with that are very much appreciated.
Docker/macOS are not allowing access to the directory ~/Documents.
Starting with macOS Catalina, ~/Documents is a "protected directory", so you have to allow docker access to it, and docker should prompt.
However, Docker Desktop for Mac's 3.0.0 release (which I imagine you're referring to) had a bug where it did not do this properly. I imagine you need to upgrade to version 3.0.1 which was released today. Just "Check for updates"
In Docker > Preferences > Experimental features you can try disabling gRPC, and make Docker use osxfs file sharing system.
Reference: https://github.com/docker/for-mac/issues/4859#issuecomment-689012097

Do I need to install kubectl after installing docker?

Do I need to install kubectl after installing docker? Yet docker comes with its own version of kubeCtl?
I was watching this tutorial and I saw that kubectl was installed after installing docker. Even in the Kubernetes docs they say:
Note: Docker Desktop for Windows adds its own version of kubectl to
PATH. If you have installed Docker Desktop before, you may need to
place your PATH entry before the one added by the Docker Desktop
installer or remove the Docker Desktop's kubectl.
This, to me, seems to imply that it is not uncommon to install kubectl when you have installed one that comes with docker. Why is it so?
You may want to have different version of kubectl in certain scenarios. For example you may want to interact with a remote kuberneretes cluster from the same windows system with latest version of kubectl which may not be installed with docker desktop.
It's generally recommended to have a version of kubectl which matches with the Kubernetes API Server version.

Aws elastic beanstalk cli setup on Mac

I am trying to install aws elastic beanstalk cli on my mac machine. In the prerequisites it says that Python requires following:
Xcode openssl zlib readline
But, on running the command, I get:
-bash: Xcode: command not found
How am I suppose to install this?
An alternative solution is to run the aws cli inside a docker container. It will eliminate the possible issues which may be caused by the OS/library upgrading in the future.

ICP 3.1.0 Vagrant support

*I used * [1]: https://github.com/IBM/deploy-ibm-cloud-private/blob/master/docs/deploy-vagrant.md
to install ICP 2.1.0.3 on my mac.
Does it support also ICP 3.1.0?
As of right now, I believe this tool cannot be used to install ICP 3.1.0 because the relevant icp-inception image has not been added to Docker Hub. When that image is available, the tool might work if you change the version parameter on line 22 in the Vagrantfile.
Even with the correct image, there may be other configuration steps that need to be taken such as changing the k8s_version or the memory requirements, since these have changed in 3.1.0.
EDIT: The image is now available on Docker Hub, but I have not tested configuring the vagrantfile to install 3.1.0 yet.
I used it successfully to install ICP 3.1 on my Linux PC. I just had to set
version = "3.1.0"
in the Vagrantfile.

AWS Elastic Beanstalk - How To Upgrade Existing Environment from Ruby 2.1 to Ruby 2.2

AWS Elastic Beanstalk - Cannot Clone With Latest Platform or eb upgrade from Ruby 2.1 to Ruby 2.2
I've been smashing my head on this one. Back in May, AWS announced that their Ruby Elastic Environments now offer Ruby-2.2 (e.g. ruby-2.2-(passenger-standalone) or ruby-2.2-(puma)). I can't upgrade my existing ruby-2.1 environments to ruby-2.2. It appears I have to recreate them completely...that seems silly? Anyone else out there experiencing this? Am I just missing something simple?
Extra Information
I've been gleefully using ruby-2.1-(passenger-standalone) for several months in my staging and production environments. Now I'd like to upgrade them to the latest ruby-2.2 platform. The AWS documentation says this is pretty trivial, in fact some of their documentation even appear to state that you can use an eb clone <env-name> --update. That flag doesn't exist in the EB CLI 3.4.5 that I'm using :( Additionally, the web console has a Clone with Latest Platform option menu item, yet it is disabled.
It appears that all I can do to get to the latest Ruby-2.2 instances is to create a brand new environment from scratch. That's tremendously annoying.
So here's what I've tried...
$ eb status
Environment details for: staging
Application name: xyz
Region: us-west-2
Deployed Version: fbe7
Environment ID: someId
Platform: 64bit Amazon Linux 2015.03 v1.4.3 running Ruby 2.1 (Passenger Standalone)
Tier: WebServer-Standard
CNAME: bla.bla.bla.elasticbeanstalk.com
Updated: 2015-06-26 22:48:59.689000+00:00
Status: Ready
Health: Green
Great, confirms I'm using Ruby 2.1. So let's try to upgrade:
$ eb upgrade
Environment already on most recent platform version.
Okay, that's nice, so what about the platform itself:
$ eb platform select
It appears you are using Ruby. Is this correct?
(y/n): y
Select a platform version.
1) Ruby 2.2 (Puma)
2) Ruby 2.2 (Passenger Standalone)
3) Ruby 2.1 (Puma)
4) Ruby 2.1 (Passenger Standalone)
5) Ruby 2.0 (Puma)
6) Ruby 2.0 (Passenger Standalone)
7) Ruby 1.9.3
(default is 1): 2
So now, here's my platform settings:
$ eb platform show
Current default platform: Ruby 2.2 (Passenger Standalone)
New environments will be running: 64bit Amazon Linux 2015.03 v1.4.3 running Ruby 2.2 (Passenger Standalone)
Platform info for environment "staging":
Current: 64bit Amazon Linux 2015.03 v1.4.3 running Ruby 2.1 (Passenger Standalone)
Latest: 64bit Amazon Linux 2015.03 v1.4.3 running Ruby 2.1 (Passenger Standalone)
So New environments will take advantage of the Ruby-2.2 editions. That's great, but do I seriously have to retire my already configured Ruby-2.1 editions in lieu of a newly created Ruby-2.1 edition? Come on?
I found a solution for this, by using the aws cli (NOT the eb cli):
aws elasticbeanstalk update-environment --solution-stack-name "64bit Amazon Linux 2016.03 v2.1.0 running Ruby 2.3 (Puma)" --environment-name "dev-bg-123456" --region "us-east-1"
The aws cli can be installed with homebrew:
brew install awscli
My solution to this challenge was to:
Launch a brand new environment.
Create a Web Application or Worker.
Choose the environment you want, likely the latest greatest. In my case Passenger with Ruby-2.2.
I choose to deploy the Sample Application so that the new environment succeeds.
Choose the remaining options for your new environment and let it launch.
Upon successful launch, I set up all my environment variable; e.g. all my database, smtp, RAILS_ENV/RACK_ENV, etc. Then I go to my previously deployed applications, and simply deploy my latest quality version to the brand new environment.
One would agree that this is a lot more work than a simple eb upgrade. Lame sauce.
I found a different approach to this problem.
The way I made it work is similar to the comment above but I managed to update the existing beanstalk environment and not deploy code to a completely new one.
Steps I did:
Launched a completely new environment on beanstalk running the ruby version that I need, 2.3 (in my case I needed an update from Ruby 2.2 to Ruby 2.3)
SSH-ed into the new instance and installed all dependencies that my application needs (packages, dev tools etc.) - you can also do these in the .ebextensions directory
Created a custom AMI from the instance running ruby 2.3 with everything installed
Used the same command that Ralph posted but with some tweeks:
aws elasticbeanstalk update-environment --region "REGION" --environment-name "ENV_NAME" --solution-stack-name "64bit Amazon Linux 2018.03 v2.8.1 running Ruby 2.3 (Puma)" --option-settings Namespace=aws:autoscaling:launchconfiguration,OptionName=ImageId,Value="ami-
xxxxxxxx"
The AMI option-settings was key for me, as this helped me the AMI with ruby 2.3.7 installed to be used for launching the new instance on the existing environment.
Previously just hitting Ralph's suggested command failed on every try.

Resources