Skip to content

Commit

Permalink
V1.6.1 update crpd (#52)
Browse files Browse the repository at this point in the history
* Change env var name

* Update cRPD/Junos version to 23.4R1.9

* Update netomox-exp/v1.8.0
  • Loading branch information
corestate55 committed Apr 9, 2024
1 parent 03bb2bc commit e36fb61
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BATFISH_WRAPPER_IMAGE_TAG=v1.1.1
BGP_POLICY_PARSER_IMAGE_TAG=v0.5.0
FISH_TRACER_IMAGE_TAG=v1.0.0
MODEL_CONDUCTOR_IMAGE_TAG=v1.7.0
NETOMOX_EXP_IMAGE_TAG=v1.7.0
NETOMOX_EXP_IMAGE_TAG=v1.8.0
NETOVIZ_IMAGE_TAG=v0.7.0

# container port number
Expand Down
6 changes: 0 additions & 6 deletions demo/copy_to_emulated_env/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# files generated in demo scenario
*.bak
clab-topo.yaml
emulated_layer1_topology*.json
emulated.json
*_ext.json
*_spliced.json

# ruby
Gemfile.lock
2 changes: 1 addition & 1 deletion demo/copy_to_emulated_env/demo_restart-iperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ done
# configure iperf client/server
if "${WITH_CLAB:-true}"; then
ansible-runner run . -p /data/project/playbooks/restart-iperf.yaml --container-option="--net=${API_BRIDGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLERUNNER_IMAGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLE_RUNNER_IMAGE}" \
--process-isolation --process-isolation-executable docker \
--cmdline "-e ansible_runner_dir=${ANSIBLE_RUNNER_DIR} -e playground_dir=${PLAYGROUND_DIR} -e login_user=${LOCALSERVER_USER} -e network_name=${NETWORK_NAME} -k -K "
fi
4 changes: 2 additions & 2 deletions demo/copy_to_emulated_env/demo_step2-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ curl -s -X POST -H 'Content-Type: application/json' \
# generate emulated asis configs from emulated asis topology
if "${WITH_CLAB:-true}"; then
ansible-runner run . -p /data/project/playbooks/step2-1.yaml --container-option="--net=${API_BRIDGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLERUNNER_IMAGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLE_RUNNER_IMAGE}" \
--process-isolation --process-isolation-executable docker \
--cmdline "-e ansible_runner_dir=${ANSIBLE_RUNNER_DIR} -e login_user=${LOCALSERVER_USER} -e network_name=${NETWORK_NAME} -k -K "
--cmdline "-e ansible_runner_dir=${ANSIBLE_RUNNER_DIR} -e login_user=${LOCALSERVER_USER} -e network_name=${NETWORK_NAME} -e crpd_image=${CRPD_IMAGE} -k -K "
fi

# update netoviz index
Expand Down
2 changes: 1 addition & 1 deletion demo/copy_to_emulated_env/demo_step2-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ curl -s -X POST -H "Content-Type: application/json" \
# configure iperf client/server
if "${WITH_CLAB:-true}"; then
ansible-runner run . -p /data/project/playbooks/step2-2.yaml --container-option="--net=${API_BRIDGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLERUNNER_IMAGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLE_RUNNER_IMAGE}" \
--process-isolation --process-isolation-executable docker \
--cmdline "-e ansible_runner_dir=${ANSIBLE_RUNNER_DIR} -e playground_dir=${PLAYGROUND_DIR} -e login_user=${LOCALSERVER_USER} -e network_name=${NETWORK_NAME} -k -K "
fi
2 changes: 1 addition & 1 deletion demo/copy_to_emulated_env/demo_step3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source ./demo_vars

# save configs from emulated env containers
ansible-runner run . -p /data/project/playbooks/step3.yaml --container-option="--net=${API_BRIDGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLERUNNER_IMAGE}" \
--container-volume-mount="$PWD:/data" --container-image="${ANSIBLE_RUNNER_IMAGE}" \
--process-isolation --process-isolation-executable docker \
--cmdline "-e ansible_runner_dir=${ANSIBLE_RUNNER_DIR} -e login_user=${LOCALSERVER_USER} -e network_name=${NETWORK_NAME} -k -K " -vvvv

Expand Down
3 changes: 2 additions & 1 deletion demo/copy_to_emulated_env/demo_vars
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ANSIBLERUNNER_IMAGE="ghcr.io/ool-mddo/mddo-ansible-runner:v3.1.0"
ANSIBLE_RUNNER_IMAGE="ghcr.io/ool-mddo/mddo-ansible-runner:v3.1.0"
CRPD_IMAGE="crpd:23.4R1.9"
API_PROXY="localhost:15000"
API_BRIDGE="playground_default"
LOCALSERVER_USER=mddo
Expand Down
10 changes: 6 additions & 4 deletions demo/copy_to_emulated_env/doc/move_seg/provision.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,26 @@
vi demo_vars
```

- `ANSIBLERUNNER_IMAGE` : Ansible runner 用コンテナイメージのリポジトリURL
- `ANSIBLE_RUNNER_IMAGE` : Ansible runner 用コンテナイメージイメージ名
- `CRPD_IMAGE` : Emulated env で使用するルータ用コンテナ (Juniper cRPD) のイメージ名
- `API_PROXY` : デモシステムのREST APIエントリポイント (api-proxy host:port)
- `API_BRIDGE` : デモシステムに接続するための docker bridge 名
- `LOCALSERVER_USER` : ホストサーバのSSHログインユーザー名
- `PLAYGROUND_DIR` : playgroundディレクトリのパス(絶対パス)
- `ANSIBLERUNNER_DIR` : Ansible runner実行ディレクトリ
- `ANSIBLE_RUNNER_DIR` : Ansible runner実行ディレクトリ
- `NETWORK_NAME` : 対象にするコンフィグリポジトリのディレクトリ名 (Batfishに入力するネットワーク名)
- `NETWORK_INDEX` : トポロジ可視化ツール(netoviz)に入力するためのネットワーク/スナップショットの情報

```bash
ANSIBLERUNNER_IMAGE="ghcr.io/ool-mddo/mddo-ansible-runner:v0.0.1"
ANSIBLE_RUNNER_IMAGE="ghcr.io/ool-mddo/mddo-ansible-runner:v3.1.0"
CRPD_IMAGE="crpd:22.1R1.10"
API_PROXY="localhost:15000"
API_BRIDGE="playground_default"
LOCALSERVER_USER=mddo
PLAYGROUND_DIR="/home/${LOCALSERVER_USER}/playground"
ANSIBLE_RUNNER_DIR="${PLAYGROUND_DIR}/demo/copy_to_emulated_env"
NETWORK_NAME="mddo-ospf"
NETWORK_INDEX="${NETWORK_NAME}_index.json"
NETWORK_INDEX="network_index/${NETWORK_NAME}.json"
```

### Passwordsファイルの作成
Expand Down
24 changes: 12 additions & 12 deletions demo/copy_to_emulated_env/project/playbooks/step2-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@
bridgedata: "{{ bridgedata | default([]) + [ data ] }}"
vars:
data:
name: "{{ item.agent_name }}"
if_list: >-
{%- for dict in item.if_list -%}
{%- if 'description' in dict -%}
{ 'name': '{{ dict.agent_name }}', 'description': '{{ dict.description }}'},
{%- else -%}
{ 'name': '{{ dict.agent_name }}' },
{%- endif -%}
{%- endfor -%}
name: "{{ item.agent_name }}"
if_list: >-
{%- for dict in item.if_list -%}
{%- if 'description' in dict -%}
{ 'name': '{{ dict.agent_name }}', 'description': '{{ dict.description }}'},
{%- else -%}
{ 'name': '{{ dict.agent_name }}' },
{%- endif -%}
{%- endfor -%}
when: '"segment" in item.type'
loop: "{{ node_list.json }}"

Expand Down Expand Up @@ -158,12 +158,12 @@

- name: "get clab topo yaml"
uri:
url: "http://localhost:15000/topologies/{{ network_name }}/emulated_asis/topology/layer3/containerlab_topology?bind_license=license.key:/tmp/license.key:ro"
url: "http://localhost:15000/topologies/{{ network_name }}/emulated_asis/topology/layer3/containerlab_topology?image={{ crpd_image }}&bind_license=license.key:/tmp/license.key:ro"
method: "GET"
body_format: json
register: containerlab

- name: Creating clab-topo.yaml
- name: Creating clab-topo.yaml
copy:
dest: "{{ ansible_runner_dir }}/clab/clab-topo.yaml"
content: "{{ containerlab.json | to_yaml }}"
Expand Down Expand Up @@ -209,7 +209,7 @@

- name: generate iperf endpoint static-route info
set_fact:
iperf_list: "{{ iperf_list | default([]) + [ item ] }}"
iperf_list: "{{ iperf_list | default([]) + [ item ] }}"
vars:
query: '*.network[{{ layer3index }}].node[*]'
when: item["mddo-topology:l3-node-attributes"]["node-type"] == 'endpoint'
Expand Down

0 comments on commit e36fb61

Please sign in to comment.