ad-build-test / BuildSystem

Testing buildsystem repo
0 stars 0 forks source link

Build and deploy build results for an IOC app - Multiple IOCs #10

Closed pnispero closed 2 months ago

pnispero commented 2 months ago

Build and deploy build results for an IOC app - Multiple IOCs

Building build results

Refer to issue #7 for the building. It will remain exactly the same here, only the deployment will be different.

Deploying build results

  1. Create ansible playbook
  2. important to add prefix, or use existing environment variables for the facility to determine the installation path
  3. One app with multiple IOCs, how to deploy, and let user choose which IOCs
  4. I think we can utilize a deployment configuration file, specifying each IOC and what version of the app it should run. Can parse this, and let user choose from that list
  5. Branch off of issue #7 since it has working functionality of deploying of an app with a Single IOC
pnispero commented 2 months ago

Working example as of BuildSystem : feat-10 - commit dc34fc6 using test-ioc - commit 0770a15 (https://github.com/ad-build-test/test-ioc/commit/0770a1567c67b33725dda67e55fe81cb3ac58407)

Contents of s3df lcls/epics (not in official directory just a test directory) before deployment

(ana-4.0.62-py3) [pnispero@sdfiana017 ~]$ find /sdf/group/ad/eed/lcls/
/sdf/group/ad/eed/lcls/
/sdf/group/ad/eed/lcls/tools
/sdf/group/ad/eed/lcls/epics
/sdf/group/ad/eed/lcls/epics/iocData
/sdf/group/ad/eed/lcls/epics/iocCommon
/sdf/group/ad/eed/lcls/epics/cpuCommon
/sdf/group/ad/eed/lcls/epics/iocTop
/sdf/group/ad/eed/lcls/epics/ioc
/sdf/group/ad/eed/lcls/epics/ioc/data
/sdf/group/ad/eed/lcls/physics
/sdf/group/ad/eed/lcls/package
(ana-4.0.62-py3) [pnispero@sdfiana017 ~]$

Run Deployment of test-ioc with bs run deployment

(adbs-env) [pnispero@sdfiana018 test-ioc]$ bs run deployment
Checking current directory if a component...
== ADBS == At the moment, deployment only for IOCs is supported
[?] Initial deployment?:
 > True
   False

[?] Point deployment to your user-space repo?:
 > True
   False

[?] What facilities to deploy to? (Arrow keys for selection, enter if done):
 > [X] S3DF
   [ ] LCLS
   [ ] FACET
   [ ] TestFac

INFO-root:[run_commands.py:37 - parse_manifest() ] {'test-ioc-1': 'test-ioc-1.0.0', 'test-ioc-2': 'test-ioc-1.0.0'}
[?] For S3DF Dev, which IOC's do you want to deploy?:
 > [X] ALL
   [ ] test-ioc-1
   [ ] test-ioc-2

[?] Specify full component tagname (ex: test-ioc-1.0.0): test-ioc-1.0.0
INFO-root:[run_commands.py:65 - run_ansible_playbook() ] ['ansible-playbook', '-i', '/sdf/home/p/pnispero/BuildSystem/ansible/ioc_module/global_inventory.ini', '-l', 'S3DF', '/sdf/home/p/pnispero/BuildSystem/ansible/ioc_module/ioc_deploy.yml', '--extra-vars', '{"initial": true, "component_name": "test-ioc", "tag": "test-ioc-1.0.0", "user": "pnispero", "tarball": "/sdf/home/p/pnispero/test-ioc/build_results/test-ioc-1.0.0.tar.gz", "ioc_dict": {"test-ioc-1": "test-ioc-1.0.0", "test-ioc-2": "test-ioc-1.0.0"}, "output_path": "/sdf/home/p/pnispero/test-ioc/ADBS_TMP", "facility": "S3DF", "user_src_repo": "/sdf/home/p/pnispero/test-ioc"}']

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

PLAY [Initial IOC Deployment] **************************************************

TASK [Create component directory at /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc] ***
changed: [localhost]

TASK [Create ioc directory at $IOC /sdf/group/ad/eed/lcls/epics/iocCommon/<ioc>] ***
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon - test-ioc-1)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon - test-ioc-2)

TASK [Create sym link /sdf/group/ad/eed/lcls/epics/iocCommon/<ioc>/iocSpecificRelease to point to /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/<tag>] ***
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-1/iocSpecificRelease -> /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-2/iocSpecificRelease -> /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0)

TASK [Create ioc directory in /sdf/group/ad/eed/lcls/epics/iocData/<ioc>] ******
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData - test-ioc-1)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData - test-ioc-2)

TASK [Create multiple data directories in /sdf/group/ad/eed/lcls/epics/iocData/<ioc>] ***
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1 - archive)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1 - autosave)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1 - autosave-req)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1 - iocInfo)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1 - restore)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1 - yaml)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2 - archive)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2 - autosave)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2 - autosave-req)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2 - iocInfo)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2 - restore)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2 - yaml)

TASK [Add startup.cmd/st.cmd for the IOC at /sdf/group/ad/eed/lcls/epics/iocCommon/<ioc>] ***
failed: [localhost] (item=== ADBS == test-ioc-1) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "test-ioc-1", "value": "test-ioc-1.0.0"}, "msg": "== ADBS == UNFINSHED. Please do this step manually."}
failed: [localhost] (item=== ADBS == test-ioc-2) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "test-ioc-2", "value": "test-ioc-1.0.0"}, "msg": "== ADBS == UNFINSHED. Please do this step manually."}

TASK [== ADBS == Continue despite previous error] ******************************
ok: [localhost] => {
    "msg": "Startup.cmd automation is unfinished, please create the startup.cmd manually."
}

PLAY [Deploy app, and update envPaths] *****************************************

TASK [Extract build results to '/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc'] ***
changed: [localhost]

TASK [Update envPaths (call cram script for this) 'S3DF'] **********************
changed: [localhost]

PLAY [Normal IOC Deployment] ***************************************************

TASK [Update sym link /sdf/group/ad/eed/lcls/epics/iocCommon/<ioc>/iocSpecificRelease to point to /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/<tag>] ***
skipping: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-1/iocSpecificRelease -> /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0)
skipping: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-2/iocSpecificRelease -> /sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0)
skipping: [localhost]

TASK [Override /sdf/group/ad/eed/lcls/epics/iocCommon/<ioc>/iocSpecificRelease to point to /sdf/home/p/pnispero/test-ioc] ***
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-1/iocSpecificRelease -> /sdf/home/p/pnispero/test-ioc)
changed: [localhost] => (item=/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-2/iocSpecificRelease -> /sdf/home/p/pnispero/test-ioc)

PLAY RECAP *********************************************************************
localhost                  : ok=10   changed=8    unreachable=0    failed=0    skipped=1    rescued=1    ignored=0

[WARNING]: Platform linux on host localhost is using the discovered Python
interpreter at /sdf/home/p/pnispero/.conda/envs/adbs-env/bin/python3.12, but
future installation of another Python interpreter could change the meaning of
that path. See https://docs.ansible.com/ansible-
core/2.17/reference_appendices/interpreter_discovery.html for more information.
[WARNING]: Cannot set fs attributes on a non-existent symlink target. follow
should be set to False to avoid this.
Playbook execution finished with return code: 0
(adbs-env) [pnispero@sdfiana018 test-ioc]$

Contents of s3df lcls/epics (not in official directory just a test directory) AFTER deployment

(ana-4.0.62-py3) [pnispero@sdfiana017 ~]$ find /sdf/group/ad/eed/lcls/
/sdf/group/ad/eed/lcls/
/sdf/group/ad/eed/lcls/tools
/sdf/group/ad/eed/lcls/epics
/sdf/group/ad/eed/lcls/epics/iocData
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2/archive
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2/autosave-req
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2/iocInfo
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2/yaml
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2/restore
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-2/autosave
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1/autosave-req
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1/iocInfo
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1/restore
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1/archive
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1/yaml
/sdf/group/ad/eed/lcls/epics/iocData/test-ioc-1/autosave
/sdf/group/ad/eed/lcls/epics/iocCommon
/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-2
/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-2/iocSpecificRelease
/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-1
/sdf/group/ad/eed/lcls/epics/iocCommon/test-ioc-1/iocSpecificRelease
/sdf/group/ad/eed/lcls/epics/cpuCommon
/sdf/group/ad/eed/lcls/epics/iocTop
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/iocBoot
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/iocBoot/iocGuardianTest
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/iocBoot/iocGuardianTest/Makefile
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/iocBoot/iocGuardianTest/st.cmd
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/iocBoot/iocGuardianTest/envPaths
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/iocBoot/Makefile
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/db
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/db/guardian_device_data.db
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/db/guardian_snapshot.db
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/db/test.db
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/dbd
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/dbd/Guardian.dbd
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/bin
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/bin/linuxRT-x86_64
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/bin/linuxRT-x86_64/Guardian
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/bin/rhel7-x86_64
/sdf/group/ad/eed/lcls/epics/iocTop/test-ioc/test-ioc-1.0.0/bin/rhel7-x86_64/Guardian
/sdf/group/ad/eed/lcls/epics/ioc
/sdf/group/ad/eed/lcls/epics/ioc/data
/sdf/group/ad/eed/lcls/physics
/sdf/group/ad/eed/lcls/package
(ana-4.0.62-py3) [pnispero@sdfiana017 ~]$

Notes

Options: -c, --component TEXT Component Name -b, --branch TEXT Branch Name -i, --initial Initial deployment -o, --override Point deployment to your user-space repo -s, --s3df Deploy to S3DF Dev -l, --lcls Deploy to LCLS Prod -f, --facet Deploy to FACET Prod -t, --testfac Deploy to TestFac Prod -h, --help Show this message and exit. (adbs-env) [pnispero@sdfiana018 test-ioc]$