1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Oracle Analytics Cloud:プライベート・アクセス・チャネルでプライベート・Gitリポジトリにアクセス

Posted at

Oracle Analytics Cloud「OACで略称」のセマンティックモデルをGitリポジトリでバージョン管理の機能があり、GitHubとの統合方法が下記にありますが、今回プライベート・アクセス・チャネルでプライベート・サブネットのGitサーバーに接続する方法を紹介します。
Oracle Analytics Cloud Classic:セマンティック・モデラーでGitを利用する

構成図

image.png

手順

  1. パブリックのOracle Analytics Cloudの作成
  2. プライベートGitサーバーにアクセスする用のBastionの作成
  3. プライベートGitサーバーの作成
  4. Gitサーバーでのリポジトリ作成
  5. OACのプライベート・アクセス・チャネル作成
  6. OACのセマンティックモデルとGitサーバーの統合設定

パブリックのOracle Analytics Cloudの作成

image.png

プライベートGitサーバーにアクセスする用のBastionの作成

プライベートのGitサーバーを操作するため、まずBastionを作成します。パブリック・サブネットを使用して、Oracle Cloud Infrastructureのコンピュート・インスタンスでBastionを作成します。
image.png

プライベートGitサーバーの作成

Bastionと同じVCNのプライベート・サブネットを使用して、Oracle Cloud Infrastructureのコンピュート・インスタンスでプライベートのGitサーバーを作成します。
image.png
プライベートのGitサーバーは作成されたら、Bastionを経由してGitサーバーにGitコマンドのパッケージをインストールします。

[opc@bob-apcompute01 ~]$ ssh -i ssh-key-2025-03-17.key opc@10.0.2.218
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Mon Mar 24 06:04:20 2025 from 10.0.0.254
[opc@instance-20250317-1747 ~]$ git
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--config-env=<name>=<envvar>] <command> [<args>]

sudo yum install gitでgitをインストールする場合、事前に下記のルート・ルールとNATゲートウェイを作成し、プライベート・サブネットに設定する必要となります。
image.png
image.png

Gitサーバーでのリポジトリ作成

下記のコマンドを実行して、Gitのリポジトリを作成し、初期化します。

[opc@instance-20250317-1747 ~]$ mkdir -p /home/opc/git/repo.git
[opc@instance-20250317-1747 ~]$ cd /home/opc/git/repo.git
[opc@instance-20250317-1747 repo.git]$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /home/opc/git/repo.git/.git/

OACのプライベート・アクセス・チャネル作成

OACからプライベートGitサーバーにアクセスするため、プライベート・アクセス・チャネルを作成します。Gitサーバー同じVCNとプライベート・サブネットを使用します。またはDNSゾーンの内容をGitサーバーのドメインで設定する必要となります。GitサーバーのドメインはFQDNからホスト名を除いた部分です。例えば
ホスト名:instance-20250317-1747
FQDN:instance-20250317-1747.dshandson.dshandson.oraclevcn.com
DNSゾーン:dshandson.dshandson.oraclevcn.com
image.png
image.png

OACのセマンティックモデルとGitサーバーの統合設定

OACでセマンティックモデルを作成し、Gitサーバーとの統合を設定します。
セマンティックモデルの編集画面の右下にGitの設定アイコンがあり、それをクリックします。また下記画面の「開始」ボタンをクリックします。
image.png
image.png
GitリポジトリURLにopc@instance-20250317-1747.dshandson.dshandson.oraclevcn.com:/home/opc/git/repo.gitを入れて、「続行」をクリックします。
image.png
Gitサーバーのアクセス認証をプロファイルとして作成します。アルゴリズムを「RSA」で指定し、「キーの生成」をクリックします。
image.png
「コピー・キー」をクリックし、コピーしたキーをGitサーバーの/home/opc/.ssh/authorized_keysに設定します。最後に「Gitの初期化」をクリックします。
image.png
これで設定が完了し、セマンティックモデルをプライベートGitサーバーにプッシュします。
image.png
最後に、Gitサーバーでセマンティックモデルのファイルをアップロードした結果を確認します。

[opc@instance-20250317-1747 .git]$ git ls-tree -r refs/heads/main --name-only
logical/SHJP.json
logical/SHJP/CHANNELS.json
logical/SHJP/COSTS.json
logical/SHJP/COUNTRIES.json
logical/SHJP/CUSTOMERS.json
logical/SHJP/PRODUCTS.json
logical/SHJP/PROMOTIONS.json
logical/SHJP/SALES.json
logical/SHJP/TIMES.json
physical/MyDatabase.json
physical/MyDatabase/SHJP.json
physical/MyDatabase/SHJP/CHANNELS.json
physical/MyDatabase/SHJP/COSTS.json
physical/MyDatabase/SHJP/COUNTRIES.json
physical/MyDatabase/SHJP/CUSTOMERS.json
physical/MyDatabase/SHJP/PRODUCTS.json
physical/MyDatabase/SHJP/PROMOTIONS.json
physical/MyDatabase/SHJP/SALES.json
physical/MyDatabase/SHJP/TIMES.json
physical/MyDatabase/SHJP/USER_SECURITY.json
presentation/SHJP.json
presentation/SHJP/CHANNELS.json
presentation/SHJP/COSTS.json
presentation/SHJP/COUNTRIES.json
presentation/SHJP/CUSTOMERS.json
presentation/SHJP/PRODUCTS.json
presentation/SHJP/PROMOTIONS.json
presentation/SHJP/SALES.json
presentation/SHJP/TIMES.json
variables/DataSecurity.json
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?