Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

mwillebrands
Copy link
Contributor

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:

  • The script now starts the executable if it is passed
  • When a file change is detected and we are running as service (based on the Executable parameter), the service is stopped
  • The file changes are then synced
  • The service is started

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

  • The entry point no longer starts the service itself
  • The entry point passes the path to the executable to the Watch-Directory script

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\App_Data\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.

…rocessingEngine) will be stopped and restarted to sync changes.
@sc-olenanosenko
Copy link
Contributor

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

@mwillebrands
Copy link
Contributor Author

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
Copy link
Contributor

sc-olenanosenko commented Apr 14, 2022

@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
Copy link
Contributor Author

@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
Copy link
Contributor

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

@sc-olenanosenko sc-olenanosenko merged commit f5517de into Sitecore:main Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants