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

Tracking pack changes from repo or git urls #2

Open
kevb opened this issue Mar 3, 2019 · 6 comments
Open

Tracking pack changes from repo or git urls #2

kevb opened this issue Mar 3, 2019 · 6 comments
Labels
question Further information is requested

Comments

@kevb
Copy link
Collaborator

kevb commented Mar 3, 2019

Current swarm-sync track a single "config repo" which contains the definition of the cluster state (example: https://github.com/kevb/swarm-sync-example).

Right now, all packs are defined in this repo too, so it's easy to know if any pack changes.

I've now pushed a change to swarm-pack to allow installing a pack from an "official repository" of packs (https://github.com/swarm-pack/repository) or just directly from a git url.

To allow the same in swarm-sync, we need to be able to track changes in both the official repo and custom git urls.

Options:

  1. Checkout and track both the official repo and custom URLs in swarm-sync and track them along with the main config repo, or
  2. Make commands in swarm-pack to fetch the "version" for a given repo pack or for a custom URL/path.

Option 2 seems a little clunky as we will duplicate a lot of stuff between ss & sp.

Option 1 - we would need to decide what is a "version". I really like the git commit idea - can we use this? Does it "fit" in swarm-pack?

@vudknguyen
Copy link
Collaborator

My suggestion will be another option:

  • Swarm pack will hold a responsibility to a registered repository
  • It will have a new feature to track update for the installed packs, and there is a command to do update version just for an installed packs

The command would be

# Check for latest version of installed pack
swarm-pack outdated
# Auto update all installed packs to latest version
swarm-pack update

# Update to latest version of a pack
swarm-pack update <pack_name>

#Update to a specific version of a pack
swarm-pack update <pack_name> <version>

@kevb
Copy link
Collaborator Author

kevb commented Mar 3, 2019 via email

@kevb
Copy link
Collaborator Author

kevb commented Mar 8, 2019

Latest solution is SS calls SP->inspectPack() to get the latest commit but SS manages the state of what is currently deployed.

I'm not sure if we can move this responsibility to SP, but I'll leave this open for now for discussion.

@kevb kevb added the question Further information is requested label Mar 8, 2019
@vudknguyen
Copy link
Collaborator

I checked the logic of that, seems to depend on the particular commit_hash of the pack with "inspect" API.

I think we can replace the commit_hash with version, so it only updates if a version is changed, not by the commit, can also expose the API upgrade that swarm-sync can call and pass value on

@kevb
Copy link
Collaborator Author

kevb commented Mar 18, 2019

I agree in theory that version might be better than commit hash. But I have reservations:

  • I really don't like keeping the version in package.json or another file. It's not immutable and prone to error. I like the definitive version to come from git tags and controlled by the CI, or something similar. I am open to having my mind changed : )

  • I wonder what is the expect behaviour in general? Looking at flux, the idea is to watch branches and sync when the branch changes. If using version number, there's a question of what constitutes a "change" or a "release".

Let me know your thoughts

@kevb
Copy link
Collaborator Author

kevb commented Mar 20, 2019

Seems like Helm uses version number, and version is always incremented for a commit, e.g. helm/charts@734a876

I wonder if it's possible to automate this or have a safeguard, like a pre-commit hook?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants