Oracle Analytics Cloud「OACで略称」のセマンティックモデルをGitリポジトリでバージョン管理の機能があり、GitHubとの統合方法が下記にありますが、今回プライベート・アクセス・チャネルでプライベート・サブネットのGitサーバーに接続する方法を紹介します。
Oracle Analytics Cloud Classic:セマンティック・モデラーでGitを利用する
構成図
手順
- パブリックのOracle Analytics Cloudの作成
- プライベートGitサーバーにアクセスする用のBastionの作成
- プライベートGitサーバーの作成
- Gitサーバーでのリポジトリ作成
- OACのプライベート・アクセス・チャネル作成
- OACのセマンティックモデルとGitサーバーの統合設定
パブリックのOracle Analytics Cloudの作成
プライベートGitサーバーにアクセスする用のBastionの作成
プライベートのGitサーバーを操作するため、まずBastionを作成します。パブリック・サブネットを使用して、Oracle Cloud Infrastructureのコンピュート・インスタンスでBastionを作成します。
プライベートGitサーバーの作成
Bastionと同じVCNのプライベート・サブネットを使用して、Oracle Cloud Infrastructureのコンピュート・インスタンスでプライベートのGitサーバーを作成します。
プライベートの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ゲートウェイを作成し、プライベート・サブネットに設定する必要となります。
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
OACのセマンティックモデルとGitサーバーの統合設定
OACでセマンティックモデルを作成し、Gitサーバーとの統合を設定します。
セマンティックモデルの編集画面の右下にGitの設定アイコンがあり、それをクリックします。また下記画面の「開始」ボタンをクリックします。
GitリポジトリURLにopc@instance-20250317-1747.dshandson.dshandson.oraclevcn.com:/home/opc/git/repo.git
を入れて、「続行」をクリックします。
Gitサーバーのアクセス認証をプロファイルとして作成します。アルゴリズムを「RSA」で指定し、「キーの生成」をクリックします。
「コピー・キー」をクリックし、コピーしたキーをGitサーバーの/home/opc/.ssh/authorized_keys
に設定します。最後に「Gitの初期化」をクリックします。
これで設定が完了し、セマンティックモデルをプライベートGitサーバーにプッシュします。
最後に、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