Skip to content

Execution

Akashdeep Dhar edited this page Dec 20, 2024 · 4 revisions

For development

  1. Enable and start the Redis service unit for the worker service of SyncStar to exchange tasks during the service runtime.

    $ sudo systemctl enable redis.service
    
    $ sudo systemctl start redis.service
    
  2. In a separate terminal session, execute the following command to start the endpoint service in an activated virtual environment.

    $ source venv/bin/activate
    
    (venv) $ syncstar --images $SYNCSTAR_ISOSYAML --source redis://localhost:6379/0 --repair false apim --help 
    
    Usage: syncstar apim [OPTIONS]
    
      Start the frontend service
    
    Options:
      -f, --feed TEXT           Add the feed to read relevant recent information from.
      -p, --port INTEGER RANGE  Set the port value for the service frontend endpoints.  [default: 8080; 64<=x<=65535]
      -u, --username TEXT       Set the username for service authentication.  [default: root]
      -w, --password TEXT       Set the password for service authentication.  [default: root]
      --help                    Show this message and exit.
    
    (venv) $ syncstar --images $SYNCSTAR_ISOSYAML --source redis://localhost:6379/0 --repair false apim --feed $SYNCSTAR_FEED_FEDORA_ONE --feed $SYNCSTAR_FEED_FEDORA_TWO --port 8080 --username $SYNCSTAR_USERNAME --password $SYNCSTAR_PASSWORD
    
    • This will start the endpoint service on port 8080 available across all network interfaces of the host device.
    • The feed entries will be fetched from the sources $SYNCSTAR_FEED_FEDORA_ONE and $SYNCSTAR_FEED_FEDORA_TWO.
    • The provided username $SYNCSTAR_USERNAME and password $SYNCSTAR_PASSWORD will be utilized for authentication.
    • The debug mode for the endpoint service will be disabled and the logging level will be set to INFO by default.
    • The task scheduling and reporting will be performed on the Redis instance deployed on redis://localhost:6379/0.
    • The images archive configuration file $SYNCSTAR_ISOSYAML will be used as a source for the live images archive.
  3. In a separate terminal session, execute the following command to start the worker service in an activated virtual environment

    # source venv/bin/activate
    
    (venv) # syncstar --images $SYNCSTAR_ISOSYAML --source redis://localhost:6379/0 --repair false cell --help 
    
    Usage: syncstar cell [OPTIONS]
    
      Start the worker service
    
    Options:
      -p, --proc INTEGER RANGE  Set the number of concurrent worker tasks allowed.  [default: 8; 4<=x<=20]
      -c, --poll INTEGER RANGE  Set the number of completion checks for termination.  [default: 8; 4<=x<=12]
      --help                    Show this message and exit.
    
    (venv) # syncstar --images $SYNCSTAR_ISOSYAML --source redis://localhost:6379/0 --repair false cell --proc 8 --poll 4
    
    • This will start the worker service that would allow up to 8 concurrent tasks running at any point in time.
    • The debug mode for the worker service will be disabled and the processes will perform 4 checks for long tasks.
    • The task scheduling and reporting will be performed on the Redis instance deployed on redis://localhost:6379/0.
    • The images archive configuration file $SYNCSTAR_ISOSYAML will be used as a source for the live images archive.
  4. Visit the homepage of the endpoint service using the browser of your choice to get started with using SyncStar.

    https://localhost:8080
    

For consumption

  1. Ensure that the Redis service unit is active and check the status of the service.

    $ sudo systemctl start redis.service
    
    $ sudo systemctl status redis.service
    
  2. Ensure that the ss-endpoint.service unit file is properly configured before starting the service.

    $ sudo nano /etc/systemd/system/ss-endpoint.service
    
    $ sudo systemctl enable --now ss-endpoint.service
    
  3. Ensure that the ss-worker.service unit file is properly configured before starting the service.

    $ sudo nano /etc/systemd/system/ss-worker.service
    
    $ sudo systemctl enable --now ss-worker.service
    
  4. Visit the homepage of the endpoint service using the browser of your choice to get started with using SyncStar.

    https://localhost:8080
    
Clone this wiki locally