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

Feature: Update local YAMLs to tic templates and account for user changes #194

Closed
pat-s opened this issue Nov 1, 2019 · 2 comments
Closed
Labels

Comments

@pat-s
Copy link
Member

pat-s commented Nov 1, 2019

This is a complex task. Below is sketch how this could work:

  1. Every template comes with an ID so that we know which tic template we should look up
  2. Every template has a part "TEMPLATE start/end" which will be strictly replaced with the upstream template
  3. Then we enforce users to put local modifications to the templates in a section which is encapsulated by "USER CHANGES". During the update process, we look for this part and simply append it to the upstream template part
  4. We check for possible duplicates and delete the duplicated parts from the TEMPLATE part since the user changes have higher preference
  5. We tell the user which part we deleted from the TEMPLATE part due to the local changes which are stored in his YAML

Most often changes will be made for installing additional system libs. In this case, there will be no conflict at all because we do not define this part in the tic templates.
Other changes I see are mods to the env vars. This is a case that we should be able to catch in a descriptive way using the approach outlined above.

If users follow the principle to install any R deps only via tic.R, I am positive that this approach could work.
In the end, the user would only need to call tic::update_yaml() and everything will just work.

@pat-s
Copy link
Member Author

pat-s commented Jan 22, 2020

Proposal

  • Add a commented anchor which specifies the string that the respective use_*_yml() fun take, i.e. # linux-deploy.
  • This anchor can then be found and trigger a call to use_*_yml(), updating the currently active template.

@pat-s
Copy link
Member Author

pat-s commented May 20, 2020

Done in 0b9a80e.

@pat-s pat-s closed this as completed May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant