anthoscli ERROR on installing Google Cloud SDK on Apple Silicon / Big Sur - google-cloud-platform

I am searching for the solution for some weeks now. A couple weeks ago I received the new MacBook Pro with the Apple Silicon processor and with Big Sur installed on it. When I tried to install Google Cloud SDK, because I need that for my work, I get my first problem. I opened the terminal and used "curl https://sdk.cloud.google.com | bash" to start the installation.
After I received the question if I want to help to improve Google Cloud SDK and hit 'N' this error follows. Also when I hit 'Y'...
ERROR: (gcloud.components.update) The following components are unknown [anthoscli].
On the internet I can't found something about this error. The only thing what I have found on anthoscli is that I think it has something to do with Kubernetes and/or Docker. So I tried to install Docker first, only they are not ready for Apple Silicon yet...
I can't imagine being the only one with this problem so I hope someone here can help me further.

It's a known issue "Apple Silicon Installer does not exist"
The workaround from the above link is:
Attempt install: curl https://sdk.cloud.google.com | bash
Run installer manually using files from above failed install ./google-cloud-sdk/bin/gcloud components install core gsutil
Re-run init: ./google-cloud-sdk/bin/gcloud init

I got gcloud to install by installing under Rosetta 2.
curl https://sdk.cloud.google.com > install.sh
chmod +x install.sh
arch -x86_64 install.sh --disable-prompts
# restart shell
gcloud help
I don't think Apple did a good job of advertising this feature, because I only found it in a random Hacker News thread. I've used this strategy quite a bit and added this to my shell's rc file.
x86() {
arch -x86_64 $1
}
x86 install.sh --disable-prompts

I just tested on Apple M1 MBP Big Sur 11.1, which works for me.
Followed mager.co blogpost-How to install gcloud on an M1 Mac
Full steps as following:
Install homebrew package management first
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Python 3.9.1 use pyenv
brew install pyenv
pyenv install 3.9.1
pyenv global 3.9.1
Set an env variable letting the gcloud installer know which version of Python to use:
export CLOUDSDK_PYTHON=python3
Download the SDK and start the install, which I ran into ERROR the following components are unknown [anthoscli, kuberun]:
curl https://sdk.cloud.google.com | bash
Thus manually run the install.sh script
cd ~/google-cloud-sdk
./install.sh --override-components core gcloud-deps bq gcloud gsutil

The easiest way to install Google Cloud SDK is with homebrew, but Homebrew doesn't have an arm64 variant for M1 yet. Nonetheless, I've outlined steps to install and use it on M1 Macs: https://stackoverflow.com/a/66299285/2006016
1. Installing gcloud SDK
After installing your Homebrew on your M1 Mac, in your Rosetta Terminal, run the following command:
brew install --cask google-cloud-sdk
2. Linking gcloud to $PATH
Once Homebrew has it installed, you'll need to add it to your path. In the last few lines it will show you the path to set your source:
From the screenshot above, I'll have to run the following to set the command in my $PATH:
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
3. Using gcloud
Once linked, you can use the gcloud command in your terminal:
gcloud -v
4. Outdated Python
In case your python is outdated (see Google Cloud SDK Requirements), you can use Homebrew to update it by running:
brew upgrade
You can view your python version when listing out your Homebrew packages:
brew outdated

This happens when you have MAC M1 chip so you might need to install manually for this i choose to go with Google given method
muhasan#Admins-MacBook-Pro ~ % curl https://sdk.cloud.google.com | bash
Output :
For the latest full release notes, please visit:
https://cloud.google.com/sdk/release_notes
╔════════════════════════════════════════════════════════════╗
╠═ Creating update staging area ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: BigQuery Command Line Tool ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: BigQuery Command Line Tool (Platform Spec... ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: Cloud Storage Command Line Tool ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: Cloud Storage Command Line Tool (Platform... ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: Default set of gcloud commands ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: Google Cloud CLI Core Libraries (Platform... ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: anthoscli ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: anthoscli ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: gcloud cli dependencies ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Creating backup and activating new installation ═╣
╚════════════════════════════════════════════════════════════╝
Performing post processing steps...done.
Update done!

Please follow the steps mentioned in the following Google Cloud SDK Installation Documentation to install Google Cloud SDK on MacOS:
Cloud SDK requires Python. Follow the next documentation on how to choose and configure your Python interpreter
Download the MacOS package from the Google Cloud SDK Documentation.
2.1) Extract the archive to any location on your file system. On macOS, this can be achieved by opening the downloaded .tar.gz archive file in the preferred location.
2.2) Optional. Use the install script to add Cloud SDK tools to your path -->
./google-cloud-sdk/install.sh
2.3) Close and Open a new terminal so that the changes take effect.
2.4) Run gcloud init to initialize the SDK:
./google-cloud-sdk/bin/gcloud init
As I can see that you have use the Google Cloud SDK Installer to install Google Cloud SDK on MacOS. Please try again the following steps to install Google Cloud SDK using the installer:
Enter the following at a command prompt:
curl https://sdk.cloud.google.com | bash
Restart your shell:
exec -l $SHELL
Run gcloud init to initialize the gcloud environment:
gcloud init
In case you want to install Google Cloud SDK through the interactive installer, and you are getting the error mentioned above, You can create an issue on Google's Public Issue Tracker for further investigation. However also please try to install the Google Cloud SDK without the installer as I mentioned before.

Related

Google Cloud Platform: VM Monitoring agent installation failing

I tried installing the monitoring agent multiple times using both Google Cloud Console & Command Line. None of the approach worked.
My OS Version:
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Installation Logs:
curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh
sudo bash add-monitoring-agent-repo.sh --also-install
Error:
Err:10 https://packages.cloud.google.com/apt google-cloud-monitoring-bullseye-all Release
404 Not Found [IP: 142.250.182.206 443]
It fails because it's getting 404 from the legacy monitoring agent source list and you need the updated Cloud Ops Agent script:
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh
You would also need to remove the apt source of google-cloud-monitoring:
sudo rm /etc/apt/sources.list.d/google-cloud-monitoring.list
Then run the script installation inside the VM Instance:
sudo bash add-google-cloud-ops-agent-repo.sh --also-install
As the Legacy Monitoring Agent does not support the Debian 11 Bullseye.

How to install extra linux package in GCP Composer?

I have written a dag which uses mongoexport command in BashOperator. By default mongoexport package is not installed in composer. I will need to install it using below command:
sudo apt install mongo-tools
We can directly install PyPi packages in composer as there is direct option available in gcp console for that.
But how can i install apt package in all nodes of composer? also that package should be effective in case of autoscaling.

gcloud app deploy crashes with "Unable to assign value to attribute 'timezone'" on Cloud SDK version 297.0.0

Using gcloud app deploy to deploy to App Engine will fail if cron.yaml or cron.xml contains timezone information, when run using Cloud SDK 297.0.0.
For example:
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/path/to/file/cron.yaml]
[INFO] GCLOUD: Unable to assign value 'America/New_York' to attribute 'timezone':
[INFO] GCLOUD: timezone 'America/New_York' is unknown
The workaround is to downgrade to version 296.0.1 of the Cloud SDK. (Substitute 296.0.1 for VERSION below.)
If you installed the SDK directly (outside of a package manager), you should use gcloud components to update: gcloud components update --version VERSION. This includes all installation mechanisms on this page (including the interactive installer, static versions, Windows installer, and Homebrew) but excludes the two following bullets.
If you installed via the rapture repo for Debian/Ubuntu: sudo apt-get update && sudo apt-get install google-cloud-sdk=VERSION-0
If you installed via the rapture repo for RedHat/CentOS: sudo yum downgrade google-cloud-sdk-VERSION
If for any reason any of the above do not work, use the download archive to manually download an older version, and install using http://cloud/sdk/docs/downloads-versioned-archives.
I got the same problem and I wrote a ticket to the GCP support.
It seems that they are not well aware of the bug.

Unable to install AWS SAM Cli on Mac

I am trying to install AWS SAM Cli on my Mac because I am trying to learn the AWS services. But I have installed the AWS cli successful using bundle. But when I tried to install the AWS SAM Cli as well. But it is not working. This is what I have done so far.
Run this command
pip install --user aws-sam-cli
Everything went fine.
Then I opened and edited the ~/.bash_profile. This is the content of the .bash_profile
export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH
# Find your Python User Base path (where Python --user will install packages/scripts)
$ USER_BASE_PATH=$(python -m site --user-base)
# Update your preferred shell configuration
-- Standard bash --> ~/.bash_profile
-- ZSH --> ~/.zshrc
export PATH=$PATH:$USER_BASE_PATH/bin
Then I closed the terminal and run sam --version.
It is saying command not found. What is wrong with my installation?
The now recommended way to install SAM CLI is to use brew and honestly it's way better, saves you a lot of headaches, like the one you're facing now. See these instructions for details.

Unable to run yum command on IBM DSX notebook

I am unable to run yum command in DSX environment. I need yum command access to install some packages.
Here's the error I am seeing when I type in "!yum install sox" command in DSX notebook:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
This is possible duplicate of this
Can I use MeCab on IBM Data Science Experience
You cannot use yum in DSX Notebook attach to Apache Spark service on Bluemix.
Given Apache Spark service on bluemix does not allow user to install any root level packages which are usually** installed using yum as well.
The only alternative is for you to either try to see if you can download source using !wget or !curl and then try to see if you can compile it, if the package doesn't need any root permission technically , you should be able to compile and install it using make.
You can also raise feature enhancement for getting this package installed by default.
http://ibm.biz/dsxideas
Thanks,
Charles.