在google云服务器上配置podman进行部署

问题描述 投票:0回答:1

我使用的是 Fedora 39 Workstation KDE,我想将我的模型部署到 Google Cloud 中的项目。我已经在我的系统上安装了 Google Cloud SDK:

spool@fedora:~$ curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-469.0.0-linux-x86_64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  197M  100  197M    0     0   531k      0  0:06:20  0:06:20 --:--:--  692k
spool@fedora:~$ tar -xf google-cloud-cli-469.0.0-linux-x86_64.tar.gz
spool@fedora:~$ ./google-cloud-sdk/install.sh
Welcome to the Google Cloud CLI!

To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. This data is
handled in accordance with our privacy policy
<https://cloud.google.com/terms/cloud-privacy-notice>. You may choose to opt in this
collection now (by choosing 'Y' at the below prompt), or at any time in the
future by running the following command:

    gcloud config set disable_usage_reporting false

Do you want to help improve the Google Cloud CLI (y/N)?  N


Your current Google Cloud CLI version is: 469.0.0
The latest available version is: 469.0.0

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                    Components                                                   │
├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────────┬───────────┤
│     Status    │                         Name                         │              ID              │    Size   │
├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────────┼───────────┤
│ Not Installed │ App Engine Go Extensions                             │ app-engine-go                │   4.7 MiB │
│ Not Installed │ Appctl                                               │ appctl                       │  21.0 MiB │
│ Not Installed │ Artifact Registry Go Module Package Helper           │ package-go-module            │   < 1 MiB │
│ Not Installed │ Cloud Bigtable Command Line Tool                     │ cbt                          │  17.2 MiB │
│ Not Installed │ Cloud Bigtable Emulator                              │ bigtable                     │   7.1 MiB │
│ Not Installed │ Cloud Datastore Emulator                             │ cloud-datastore-emulator     │  36.2 MiB │
│ Not Installed │ Cloud Firestore Emulator                             │ cloud-firestore-emulator     │  44.5 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator                               │ pubsub-emulator              │  63.3 MiB │
│ Not Installed │ Cloud Run Proxy                                      │ cloud-run-proxy              │  13.3 MiB │
│ Not Installed │ Cloud SQL Proxy                                      │ cloud_sql_proxy              │   7.8 MiB │
│ Not Installed │ Cloud Spanner Emulator                               │ cloud-spanner-emulator       │  36.0 MiB │
│ Not Installed │ Cloud Spanner Migration Tool                         │ harbourbridge                │  20.9 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr        │   1.8 MiB │
│ Not Installed │ Kustomize                                            │ kustomize                    │   4.3 MiB │
│ Not Installed │ Log Streaming                                        │ log-streaming                │  13.9 MiB │
│ Not Installed │ Minikube                                             │ minikube                     │  35.4 MiB │
│ Not Installed │ Nomos CLI                                            │ nomos                        │  28.7 MiB │
│ Not Installed │ On-Demand Scanning API extraction helper             │ local-extract                │  14.4 MiB │
│ Not Installed │ Skaffold                                             │ skaffold                     │  23.4 MiB │
│ Not Installed │ Spanner migration tool                               │ spanner-migration-tool       │  23.5 MiB │
│ Not Installed │ Terraform Tools                                      │ terraform-tools              │  66.1 MiB │
│ Not Installed │ anthos-auth                                          │ anthos-auth                  │  21.8 MiB │
│ Not Installed │ config-connector                                     │ config-connector             │  56.7 MiB │
│ Not Installed │ enterprise-certificate-proxy                         │ enterprise-certificate-proxy │   8.6 MiB │
│ Not Installed │ gcloud Alpha Commands                                │ alpha                        │   < 1 MiB │
│ Not Installed │ gcloud Beta Commands                                 │ beta                         │   < 1 MiB │
│ Not Installed │ gcloud app Java Extensions                           │ app-engine-java              │ 126.1 MiB │
│ Not Installed │ gcloud app Python Extensions                         │ app-engine-python            │   5.0 MiB │
│ Not Installed │ gcloud app Python Extensions (Extra Libraries)       │ app-engine-python-extras     │   < 1 MiB │
│ Not Installed │ gke-gcloud-auth-plugin                               │ gke-gcloud-auth-plugin       │   7.9 MiB │
│ Not Installed │ kpt                                                  │ kpt                          │  14.4 MiB │
│ Not Installed │ kubectl                                              │ kubectl                      │   < 1 MiB │
│ Not Installed │ kubectl-oidc                                         │ kubectl-oidc                 │  21.8 MiB │
│ Not Installed │ pkg                                                  │ pkg                          │           │
│ Installed     │ BigQuery Command Line Tool                           │ bq                           │   1.7 MiB │
│ Installed     │ Bundled Python 3.11                                  │ bundled-python3-unix         │  74.9 MiB │
│ Installed     │ Cloud Storage Command Line Tool                      │ gsutil                       │  11.3 MiB │
│ Installed     │ Google Cloud CLI Core Libraries                      │ core                         │  23.2 MiB │
│ Installed     │ Google Cloud CRC32C Hash Tool                        │ gcloud-crc32c                │   1.2 MiB │
└───────────────┴──────────────────────────────────────────────────────┴──────────────────────────────┴───────────┘
To install or remove components at your current SDK version [469.0.0], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [469.0.0], run:
  $ gcloud components update


Modify profile to update your $PATH and enable shell command completion?

Do you want to continue (Y/n)?  Y

The Google Cloud SDK installer will now prompt you to update an rc file to bring the Google Cloud CLIs into your 
environment.

Enter a path to an rc file to update, or leave blank to use [/home/spool/.bashrc]:  
Backing up [/home/spool/.bashrc] to [/home/spool/.bashrc.backup].
[/home/spool/.bashrc] has been updated.

==> Start a new shell for the changes to take effect.


For more information on how to get started, please visit:
  https://cloud.google.com/sdk/docs/quickstarts

事实上,当我打开 cmd 的新选项卡时,它可以正常工作。我可以打开我想打开的项目:

spool@fedora:~$ ./google-cloud-sdk/bin/gcloud init
Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

....


You are logged in as: [[email protected]].

Pick cloud project to use: 
 [1] arctic-badge-394712
 [2] axial-sight-417412
 [3] bamboo-antler-417319
 [4] coherent-surf-414408
 [5] hip-flare-416814
 [6] igneous-axiom-326411
 [7] ml-deployment-417517
 [8] model-block-401119
 [9] trim-habitat-408709
 [10] trim-heaven-408709
 [11] virtual-plexus-417319
 [12] Enter a project ID
 [13] Create a new project
Please enter numeric choice or text value (must exactly match list item):  7

Your current project has been set to: [ml-deployment-417517].

Not setting default zone/region (this feature makes it easier to use
[gcloud compute] by setting an appropriate default value for the
--zone and --region flag).
See https://cloud.google.com/compute/docs/gcloud-compute section on how to set
default compute region and zone manually. If you would like [gcloud init] to be
able to do this for you the next time you run it, make sure the
Compute Engine API is enabled for your project on the
https://console.developers.google.com/apis page.

Created a default .boto configuration file at [/home/spool/.boto]. See this file and
[https://cloud.google.com/storage/docs/gsutil/commands/config] for more
information about configuring Google Cloud Storage.
Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use [email protected] by default
* Commands will reference project `ml-deployment-417517` by default
Run `gcloud help config` to learn how to change individual settings

This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
Run `gcloud topic configurations` to learn more.

Some things to try next:

* Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
* Run `gcloud topic --help` to learn about advanced features of the SDK like arg files and output formatting
* Run `gcloud cheat-sheet` to see a roster of go-to `gcloud` commands.
spool@fedora:~$ gcloud auth configure-docker europe-west2-docker.pkg.dev
WARNING: `docker` not in system PATH.
`docker` and `docker-credential-gcloud` need to be in the same PATH in order to work correctly together.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
Adding credentials for: europe-west2-docker.pkg.dev
After update, the following will be written to your Docker config file located at 
[/home/spool/.docker/config.json]:
 {
  "credHelpers": {
    "europe-west2-docker.pkg.dev": "gcloud"
  }
}

Do you want to continue (Y/n)?                 

但是当我使用

gcloud auth configure-docker europe-west2-docker.pkg.dev
时,问题就在底部。这给了我这个警告,我不确定我这样做是否正确,因为我使用 podman 而不是 docker。有什么建议我可以解决这个问题吗?顺便我正在看这篇文章

docker google-cloud-platform gcloud podman
1个回答
0
投票

这很令人困惑,有几种解决方案。

为 Docker 配置 ArtifactRegistry 身份验证

注意 它显示“Docker”,但您可以互换使用“Podman”;我也用Podman

我使用访问令牌方法:

TOKEN=$(gcloud auth print-access-token)
REGION="europe-west2"

echo ${TOKEN} | podman login \
https://${REGION}-docker.pkg.dev
--username=oauth2accesstoken \
--password-stdin

第一个命令获取您的用户 (

[email protected]
) 帐户的访问令牌。

第二个命令将令牌(更安全)通过管道传输到

podman login
--username=oauth2accesstoken
是常量,并且
--password-stdin
获取您的管道令牌。

© www.soinside.com 2019 - 2024. All rights reserved.