Package: acss-core
ACSS CoreACSS (Accelerator Control and Simulation Services) provides an environment for scheduling and orchestrating of multiple intelligent agents, training and tuning of ML models, handling of data streams and for software testing and verification.User specific services are located at github (https://github.com/desy-ml/ml-pipe-services).DependenciesDocker and docker-compose >= 1.28.0 are required.Install Core ServicesClone the acss-services repository.git clone https://github.com/desy-ml/ml-pipe-servicesConfigure Core ServicesTo install the core services of ACSS you need to set the following environment values in a .env file.ACSS_EXTERNAL_HOST_ADDR=localhost
ACSS_DB_PW=xxxx
ACSS_DB_USER=xxxx
ACSS_CONFIG_FILEPATH = /path/to/ml-pipe-config.yaml
PATH_TO_ACSS_SERVICES_ROOT=/path/to/ml-pipe-servicesACSS_CONFIG_FILEPATH is the path to the yaml config file, which look like this:observer:
  # used to check if jbb is done
  url: observer:5003
  event_db_pw: xxxx
  # event_db_url:
  event_db_usr: root
register:
  # registers all services
  url: register:5004
simulation:
  # sql database which maps the machine parameter
  sim_db_pw: xxxx
  sim_db_usr: root
  sim_db_url: simulation_database:3306
msg_bus:
  # message bus
  # external_host_addr: localhost
  broker_urls: kafka_1:9092,kafka_2:9096In production replace ACSS_EXTERNAL_HOST_ADDR=localhost with the server url and set PATH_TO_ACSS_SERVICES_ROOT to the location of the cloned ml-pipe-services repository.
The environment values ACSS_DB_PW and ACSS_DB_USER define the credentials for the databases used by ACSS.Build Docker imagesOpen the root folder of the acss-core project:cd /path/to/projectTo build all docker images run:makebuild-allThis can take a while...Notes: After changing code you just need to rebuild the service images, which is much faster.make build-service-imagesYou can check if all core services are started correctly by executing:docker-compose -p pipeline psIn the project root folder.Stop Core ServicesTo stop de Core Services just runmakedownTests locallyNote: Docker and docker-compose => 2.80 is required to run tests locallyRun all tests:make tests ENV_FILE=.envRun end to end tests:make e2e-tests ENV_FILE=.envRun integration tests:make integration-tests ENV_FILE=.envRun unit testsmake unit-tests ENV_FILE=.envAdditional StuffMaxwellLog in via ssh to max-wgs.desy.deInstall python 3.8.8wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
sh Anaconda3-2021.05-Linux-x86_64.sh
export PATH=$HOME/anaconda3/bin:$PATHPyTine and K2I2K_os on Machine PETRA IIIThe machine observer and controller for PETRA III are using the PetraAdapter which is using the libs PyTine and K2I2K_os.
The Path to this libs have to be added to the PYTHONPATH.For PyTine have a look athttps://confluence.desy.de/display/HLC/Developing+with+Python.K2I2K_os can be cloned via git from:gitclonehttps://username@stash.desy.de/scm/pihp/petra3.optics.tools.gitJupyter notebookTo use KafkaPipeClient in a Jupyter notebook you need to add the virtual environment to Jupyter.First activate the python virtual environment.For PipenvpipenvshellStart the jupyter notebook:pipinstall--useripykernelNote: You have to add the virtual environment to jupyter. First, activate the virtual environment. Then run:python-mipykernelinstall--user--name=<myenv>