Possible to run a task (or command) once per application version?
- Dominant language
- No language data
- Stars
- 27
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
#### Feature Request Description
We would like to be able to NGen the assemblies in our deployed application. In order to do this, we want to be able to trigger the NGen task to run when a new version of the application is installed on a node.
#### Describe Preferred Solution
If there was some form of trigger we could hook in to when a new version of the application is deployed then we could make sure that
#### Describe Alternatives Considered
We don't deploy applications directly to nodes in a pool, but instead assign the `ApplicationPackageReferences` on the `CloudTask`. This is because we deploy multiple times per day, and our scripts update the default version for the Application. When the tasks run, they automatically use the latest available application (which is xcopy'd to the machine). Unfortunately this means that we're unable to make use of a node start task or job start task to perform the NGen operation.
We can't use our deployment script to NGen the images, because that means that if/when our nodes are re-imaged or the pool is resized the changes won't persist.
We use "long running" jobs (multiple months) with thousands of shorter tasks (minutes to hours) so we're unable to make it a start task for the job or run it with every task.
Our application does not run with admin rights so cannot trigger an NGen itself.
Because multiple versions of our application could be running in parallel (due to the long-running / always updating to latest version configuration) it's not practical for us to build a custom OS image and use that for the node.
Eventually we'll be moving to .NET6 (and making use of R2R etc) but that's probably 12 months away for us.
We have considered programmatically adding a "scheduled task" (via a node start task) to the VM that checks the application folder periodically to see if there are new assemblies to NGen (currently our favourite workaround).
Contributor guide
Assessment
This issue has not been assessed yet.