google-cloud-sdk 導入のためのメモ
1)お決まりの手順を実行
sudo dnf update
sudo dnf install epel-release
2)Google cloud repo を配置
↓以下の通り、これコピペがよいようです。
sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM
3)Install開始
dnf install google-cloud-sdk
結果は以下に(無事完了します)
dnf install google-cloud-sdk
Failed to set locale, defaulting to C.UTF-8
Google Cloud SDK 25 MB/s | 40 MB 00:01
Last metadata expiration check: 0:00:09 ago on Thu Oct 21 11:03:41 2021.
Dependencies resolved.
==============================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================
Installing:
google-cloud-sdk x86_64 361.0.0-1 google-cloud-sdk 62 M
Installing dependencies:
python2 x86_64 2.7.18-4.module_el8.4.0+668+03e3490a appstream 109 k
python2-libs x86_64 2.7.18-4.module_el8.4.0+668+03e3490a appstream 6.0 M
python2-pip-wheel noarch 9.0.3-18.module_el8.4.0+642+1dc4fb01 appstream 1.0 M
python2-setuptools-wheel noarch 39.0.1-13.module_el8.4.0+642+1dc4fb01 appstream 287 k
Installing weak dependencies:
python2-pip noarch 9.0.3-18.module_el8.4.0+642+1dc4fb01 appstream 1.7 M
python2-setuptools noarch 39.0.1-13.module_el8.4.0+642+1dc4fb01 appstream 642 k
Enabling module streams:
python27 2.7
Transaction Summary
==============================================================================================================================================================
Install 7 Packages
Total download size: 72 M
Installed size: 458 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): python2-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64.rpm 1.7 MB/s | 109 kB 00:00
(2/7): python2-pip-wheel-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch.rpm 11 MB/s | 1.0 MB 00:00
(3/7): python2-pip-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch.rpm 10 MB/s | 1.7 MB 00:00
(4/7): python2-setuptools-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch.rpm 15 MB/s | 642 kB 00:00
(5/7): python2-setuptools-wheel-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch.rpm 4.7 MB/s | 287 kB 00:00
(6/7): python2-libs-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64.rpm 21 MB/s | 6.0 MB 00:00
(7/7): 995be31acf571637d5c9e673b05b958a5cf26ee88d5ee4a0abf6bcdcd311d4cf-google-cloud-sdk-361.0.0-1.x86_64.rpm 5.8 MB/s | 62 MB 00:10
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.4 MB/s | 72 MB 00:11
warning: /var/cache/dnf/google-cloud-sdk-e92943ff8d23e2cc/packages/995be31acf571637d5c9e673b05b958a5cf26ee88d5ee4a0abf6bcdcd311d4cf-google-cloud-sdk-361.0.0-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 3e1ba8d5: NOKEY
Google Cloud SDK 35 kB/s | 3.4 kB 00:00
Importing GPG key 0x307EA071:
Userid : "Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub)"
Fingerprint: 7F92 E05B 3109 3BEF 5A3C 2D38 FEEA 9169 307E A071
From : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Is this ok [y/N]: y
Key imported successfully
Importing GPG key 0x836F4BEB:
Userid : "gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) <glinux-team@google.com>"
Fingerprint: 59FE 0256 8272 69DC 8157 8F92 8B57 C5C2 836F 4BEB
From : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Is this ok [y/N]: y
Key imported successfully
Google Cloud SDK 9.9 kB/s | 975 B 00:00
Importing GPG key 0x3E1BA8D5:
Userid : "Google Cloud Packages RPM Signing Key <gc-team@google.com>"
Fingerprint: 3749 E1BA 95A8 6CE0 5454 6ED2 F09C 394C 3E1B A8D5
From : https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python2-setuptools-wheel-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch 1/7
Installing : python2-pip-wheel-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch 2/7
Installing : python2-libs-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64 3/7
Installing : python2-pip-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch 4/7
Installing : python2-setuptools-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch 5/7
Installing : python2-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64 6/7
Running scriptlet: python2-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64 6/7
Installing : google-cloud-sdk-361.0.0-1.x86_64 7/7
Running scriptlet: google-cloud-sdk-361.0.0-1.x86_64 7/7
Verifying : python2-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64 1/7
Verifying : python2-libs-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64 2/7
Verifying : python2-pip-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch 3/7
Verifying : python2-pip-wheel-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch 4/7
Verifying : python2-setuptools-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch 5/7
Verifying : python2-setuptools-wheel-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch 6/7
Verifying : google-cloud-sdk-361.0.0-1.x86_64 7/7
Installed products updated.
Installed:
google-cloud-sdk-361.0.0-1.x86_64 python2-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64
python2-libs-2.7.18-4.module_el8.4.0+668+03e3490a.x86_64 python2-pip-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch
python2-pip-wheel-9.0.3-18.module_el8.4.0+642+1dc4fb01.noarch python2-setuptools-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch
python2-setuptools-wheel-39.0.1-13.module_el8.4.0+642+1dc4fb01.noarch
Complete!
4)gcloud infoを実行し確認
エラー以外のいろいろ表示されること。
gcloud info
5)初期化を実行
gcloud init
結果は以下に、
gcloud init
Welcome! This command will take you through the configuration of gcloud.
Your current configuration has been set to: [default]
You can skip diagnostics next time by using the following flag:
gcloud init --skip-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).
ここで以下のような問い合わせがあります
You must log in to continue. Would you like to log in (Y/n)? y
yを押すと認証のためURLが表示されます。
ブラウザーへこのURLをコピペします。
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=
〜(中略)〜code_challenge_method=S256
ブラウザーへこのURLをコピペすると、自分のGoogleのアカウント認証を経て、使用するサービスの許可を求めてきます。許可を押すと「CODE」が表示されます。
そのコードをターミナル上の「CODE」部分に投入します。
Enter verification code: 4/1AX〜(中略)〜3z0
You are logged in as: [(アカウントID)].
Pick cloud project to use:
[1] Create a new project
Please enter numeric choice or text value (must exactly match list item): 6
Enter a Project ID. Note that a Project ID CANNOT be changed later.
Project IDs must be 6-30 characters (lowercase ASCII, digits, or
hyphens) in length and start with a lowercase letter. embulk
WARNING: Project creation failed: HttpError accessing <https://cloudresourcemanager.googleapis.com/v1/projects?alt=json>: response: <{'vary': 'Origin, X-Origin, Referer', 'content-type': 'application/json; charset=UTF-8', 'content-encoding': 'gzip', 'date': 'Thu, 21 Oct 2021 02:07:55 GMT', 'server': 'ESF', 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'server-timing': 'gfet4t7; dur=662', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000', 'transfer-encoding': 'chunked', 'status': 409}>, content <{
"error": {
"code": 409,
"message": "Requested entity already exists",
"status": "ALREADY_EXISTS"
}
}
>
Please make sure to create the project [embulk] using
$ gcloud projects create embulk
or change to another project using
$ gcloud config set project <PROJECT ID>
まずは入った程度ですが、以上です