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

deploy gp cli independent #6533

Closed
akosyakov opened this issue Nov 3, 2021 · 3 comments · Fixed by #6648
Closed

deploy gp cli independent #6533

akosyakov opened this issue Nov 3, 2021 · 3 comments · Fixed by #6648

Comments

@akosyakov
Copy link
Member

akosyakov commented Nov 3, 2021

In prod we still build images with mk2, which ships gp as part of the Gitpod layer. In preparation for mk3 we started to ship gp with supervisor:

for k, v := range binaries {
var (
from = filepath.Join(base, k)
to = filepath.Join("/usr/bin", v)
)
err = os.Symlink(from, to)
if err != nil && !os.IsExist(err) {
log.WithError(err).WithField("from", from).WithField("to", to).Warn("cannot create symlink")
}
}

If the gitpod-layer is present, /usr/bin/gp will be present which makes the symlink operation fail.

To ship the gitpod-cli independently of the gitpod-layer even with mk2, we could just delete the to path prior to symlinking, i.e.

	 for k, v := range binaries {
		var (
			from = filepath.Join(base, k)
			to   = filepath.Join("/usr/bin", v)
		)

		// New code
		_ = os.Remove(to)
		// ends here

		err = os.Symlink(from, to)
		if err != nil && !os.IsExist(err) {
			log.WithError(err).WithField("from", from).WithField("to", to).Warn("cannot create symlink")
		}
	}

Error checking is left as an exercise to the reader. Beware that os.IsNotExist(err) is a valid case if there's no gitpod-layer.

@loujaybee
Copy link
Member

🤔 This is an interesting one, what would the deploy path/process look like by the end of the changes? Where would the prod artifact be stored/fetched from?

@csweichel
Copy link
Contributor

csweichel commented Nov 3, 2021

It would mean that gitpod-cli changes are subject to the same lifecycle as supervisor changes. Once
#6512 is built and merged you could ship gitpod-cli versions as part of the supervisor release yourself. Before that the updates would ship with workspace cluster deployments, much like supervisor changes do today.

@corneliusludmann
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants