メモ:Tanzu Application Catalog(TAC) のCLI を利用してみる

自分備忘録用メモ。TAC のドキュメントのUse the Tanzu Application Catalog CLI にはダウンロード手順が無かったので、、、


TAC CLI のダウンロードとインストール

こちら「Step 1: Download the Tanzu Application Catalog command line tool (the TAC CLI).」に記載があるので、手順に従ってダウンロードして、設定していきます。
tac login
tac config list

TAC CLI の利用

TAC にあるArtifact の情報をtac CLI を用いて取得出来ます。
$ tac get apps
[
 {
  "asset_type": "DOCKER_IMAGE",
  "assets": [
   {
    "asset_type": "DOCKER_IMAGE",
    "bitnami_app_id": "dotnet",
    "dependencies": [],
    "description": ".NET is an open-source server-side framework to build applications and services.",
    "id": "62eba2c5ed293d3114bceffc202ee5e201ddf462",
    "labels": {
     "branch": "3.1",
     "distro": "centos-7",
     "registry": "demodocker"
    },
    "name": ".NET Core",
    "released_at": "2021-04-11T06:42:06.000+00:00",
    "revision": "173",
    "status": "RELEASED",
    "version": "3.1.9"
   },
   ...(SNIP)...

個別のArtifact に関しても、TAC にあるArtifact の情報を tac CLI を用いて取得出来ます。
Spring Cloud Data Flow のArtifact の情報を見てみます。
$ tac get app d8bf3d72a02daf394b84657f1e711c0aa158026c
{
 "asset_type": "HELM_CHART",
 "bitnami_app_id": "spring-cloud-dataflow",
 "description": "A microservices-based Streaming and Batch data processing in Cloud Foundry and Kubernetes.",
 "id": "d8bf3d72a02daf394b84657f1e711c0aa158026c",
 "labels": {
  "branch": "2",
  "distro": "centos-7"
 },
 "name": "spring-cloud-dataflow",
 "released_at": "2021-03-18T18:25:18.000+00:00",
 "releases": [
  {
   "artifact": {
    "asset_spec": {
     "filename": "asset-spec.json",
     "id": "3b4a782728e79ef437adc03199ea7991131b628f8f8510e0e2aceebc47b8854e",
     "namespace": "demo"
    },
    "chart_release": {
     "digest": "sha256:5610fe869b0094237243b22a5fe05f02bdeb44ed6297a612a80cd87503532fd3",
     "filename": "",
     "name": "spring-cloud-dataflow",
     "package": {
      "filename": "spring-cloud-dataflow-2.10.0.tgz",
      "id": "5610fe869b0094237243b22a5fe05f02bdeb44ed6297a612a80cd87503532fd3",
      "namespace": "demo"
     },
     "repository": "https://xxxx/demo",
     "url": "https://xxxx/demo/spring-cloud-dataflow-2.10.0.tgz",
     "version": "2.10.0"
    },
    "commit": null,
    "pull_request": null,
    "test_results": [
     {
      "archive": {
       "filename": "test-results.tar.gz",
       "id": "0275f1aefcdb80c4496942cbbe1be62bf269e45e9fa47cb816b877d5e3b9c2b0",
       "namespace": "demo"
      },
      "platform": ""
     }
    ],
    "trigger_info": {
     "filename": "trigger-info.json",
     "id": "f16eddef9f0d4c035bff5c47f4ae778d1102435daf6a2bd571a70fd3cca7d000",
     "namespace": "demo"
    }
   },
   "dependencies": [
    {
     "asset_type": "DOCKER_IMAGE",
     "bitnami_app_id": "spring-cloud-dataflow",
     "dependencies": null,
     "description": "A microservices-based Streaming and Batch data processing in Cloud Foundry and Kubernetes.",
     "id": "e937c769b4569fcd05469347f9abcdfa9ef9aaa4",
     "labels": {
      "branch": "2",
      "distro": "centos-7",
      "registry": "demodocker"
     },
     "name": "spring-cloud-dataflow",
     "released_at": "2021-03-18T15:34:25.000+00:00",
     "revision": "55",
     "status": "RELEASED",
     "version": "2.7.1"
    },
    {
     "asset_type": "DOCKER_IMAGE",
     "bitnami_app_id": "spring-cloud-dataflow-composed-task-runner",
     "dependencies": null,
     "description": "The Spring Cloud Composed Task Runner is a helper used by the Data Flow server to parse a directed graph DSL, launch the task definition specified in an instance, and check task completion status.",
     "id": "fbe6f1ca3d2c736c8c4a91551451396f3b531cfa",
     "labels": {
      "branch": "2",
      "distro": "centos-7",
      "registry": "demodocker"
     },
     "name": "spring-cloud-dataflow-composed-task-runner",
     "released_at": "2021-03-17T21:45:28.000+00:00",
     "revision": "54",
     "status": "RELEASED",
     "version": "2.7.1"
    },
    {
     "asset_type": "DOCKER_IMAGE",
     "bitnami_app_id": "kubectl",
     "dependencies": null,
     "description": "Kubectl is the Kubernetes command line interface.",
     "id": "c729816c918e3c4fe0017b0095781c93c11e15db",
     "labels": {
      "branch": "1.18",
      "distro": "centos-7",
      "registry": "demodocker"
     },
     "name": "Kubectl",
     "released_at": "2021-03-17T19:05:25.000+00:00",
     "revision": "27",
     "status": "RELEASED",
     "version": "1.18.16"
    },
    {
     "asset_type": "DOCKER_IMAGE",
     "bitnami_app_id": "prometheus-rsocket-proxy",
     "dependencies": null,
     "description": "Prometheus RSocket Proxy is a collection of resources to get application metrics to Prometheus without ingress, while still preserving the pull model, using RSocket bidirectional persistent RPC.",
     "id": "455dc067a7419db05e1df98191015aaffc4cb554",
     "labels": {
      "branch": "1",
      "distro": "centos-7",
      "registry": "demodocker"
     },
     "name": "Prometheus RSocket Proxy",
     "released_at": "2021-03-17T22:54:19.000+00:00",
     "revision": "103",
     "status": "RELEASED",
     "version": "1.3.0"
    },
    {
     "asset_type": "DOCKER_IMAGE",
     "bitnami_app_id": "spring-cloud-skipper",
     "dependencies": null,
     "description": "A package manager that installs, upgrades, and rolls back Spring Boot applications on multiple Cloud Platforms.",
     "id": "b97ba5af88841bec2048626db7975f0e67f3537b",
     "labels": {
      "branch": "2",
      "distro": "centos-7",
      "registry": "demodocker"
     },
     "name": "spring-cloud-skipper",
     "released_at": "2021-03-17T15:44:53.000+00:00",
     "revision": "52",
     "status": "RELEASED",
     "version": "2.6.1"
    },
    {
     "asset_type": "HELM_CHART",
     "bitnami_app_id": "mariadb",
     "dependencies": null,
     "description": "MariaDB is an open source, community-developed SQL database server that is widely in use around the world due to its enterprise features, flexibility, and collaboration with leading tech firms.",
     "id": "39a50282922ff2f3f38e5c5ec75228d557455785",
     "labels": {
      "branch": "10.5",
      "distro": "centos-7"
     },
     "name": "MariaDB",
     "released_at": "2021-03-04T17:19:05.000+00:00",
     "revision": "1",
     "status": "RELEASED",
     "version": "10.5.9"
    },
    {
     "asset_type": "HELM_CHART",
     "bitnami_app_id": "rabbitmq",
     "dependencies": null,
     "description": "RabbitMQ is a messaging broker that gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.",
     "id": "f6a3313af10be009a16f5a6bd39cc46f46888bba",
     "labels": {
      "branch": "3.8",
      "distro": "centos-7"
     },
     "name": "RabbitMQ",
     "released_at": "2021-03-05T00:22:43.000+00:00",
     "revision": "1",
     "status": "RELEASED",
     "version": "3.8.14"
    },
    {
     "asset_type": "HELM_CHART",
     "bitnami_app_id": "kafka",
     "dependencies": null,
     "description": "Apache Kafka is publish-subscribe messaging rethought as a distributed commit log.",
     "id": "8cebcee0ce35ca9d85f8bffd4a4c705cc770f15a",
     "labels": {
      "branch": "2",
      "distro": "centos-7"
     },
     "name": "Apache Kafka",
     "released_at": "2021-03-15T10:21:16.000+00:00",
     "revision": "21",
     "status": "RELEASED",
     "version": "2.7.0"
    }
   ],
   "id": "sha256:5610fe869b0094237243b22a5fe05f02bdeb44ed6297a612a80cd87503532fd3",
   "parents": [],
   "released_at": "2021-03-18T18:25:18.000+00:00",
   "revision": "10",
   "version": "2.7.1"
  }
 ],
 "revision": "10",
 "status": "RELEASED",
 "version": "2.7.1"
}

Artifact の情報をJSON ファイルとしてダウンロード出来るので、確認してみます。
tac get artifact 3b4a782728e79ef437adc03199ea7991131b628f8f8510e0e2aceebc47b8854e

asset-spec.json というファイルがダウンロードされます。その中にはArtifact で利用されているパッケージの情報(パッケージ名、バージョン、ライセンス、タイプ etc) 確認する事が出来ました。

このブログの人気の投稿