Sitecore / docker-tools

Sitecore Docker Tools are utilities which assist Sitecore developers in initializing and running containerized Sitecore environments.
MIT License
27 stars 17 forks source link

Updated scripts to work with the services (IndexWorker, AutomationEngine, ProcessingEngine) #32

Closed mwillebrands closed 2 years ago

mwillebrands commented 2 years ago

Hi,

The current sync scripts will not work with the services like IndexWorker, AutomationEngine and ProcessingEngine, as these services place a lock on the DLL files, and these services will not automatically restart when a config has changed.

This change changes the Watch-Directory script as follows:

This change changes the Development.ps1 entrypoint script for the worker as follows

The changes make it possible to do continous development on the services instead of having to recreate the image all the time. The following entry point can now be passed from the docker-compose file:

  xdbautomationworker:
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-xdbautomationworker:${VERSION:-latest}
    entrypoint: powershell -Command "& C:\tools\entrypoints\worker\Development.ps1 -WatchDirectoryParameters @{Path = 'c:\deploy\App_Data\jobs\continuous\AutomationEngine';Destination = 'c:\service'}"

The _c:\deploy\AppData\jobs\continuous\AutomationEngine path in the above snippet is the path within the container to which my AutomationEngine files are deployed, and could of course be changed to something else or an environment variable.

sc-olenanosenko commented 2 years ago

Hi @mwillebrands ! Please, merge all updates from the 'main' branch to the 'mwillebrands:feature/ImprovedWorkerEntrypoint' to make sure that all checks passed.

mwillebrands commented 2 years ago

Hi @mwillebrands ! Please, merge all updates from the 'main' branch to the 'mwillebrands:feature/ImprovedWorkerEntrypoint' to make sure that all checks passed.

Done, but it doesn't seem to work.

sc-olenanosenko commented 2 years ago

@mwillebrands I see that all changes applied to your branch but have an issue in PowerShell tests. Link to the file with an issue: https://github.com/Sitecore/docker-tools/blob/main/image/test/scripts/Watch-Directory.Tests.ps1 Test "copies new files" doesn't work correctly. Should fix it.

mwillebrands commented 2 years ago

@sc-olenanosenko I've updated the test to increase the time that the Watch-Directory script is running. As my change lists changes before it syncs it, it is a little bit slower. The test passes without any changes on my local machine tough, so it seems that the build agent has a slower filesystem.

sc-olenanosenko commented 2 years ago

@mwillebrands Thanks for the update, I will look at it.