Giter Site home page Giter Site logo

Issue when path is symlink about overseer HOT 5 OPEN

jpillora avatar jpillora commented on June 29, 2024
Issue when path is symlink

from overseer.

Comments (5)

jpillora avatar jpillora commented on June 29, 2024

Since you're deploying to /srv/tools/<last-build-id>, does that mean you're just using overseer for graceful restarts? Or do you want to use it for upgrades (i.e. deploys) too?

from overseer.

jpillora avatar jpillora commented on June 29, 2024

In the past, I've just used S3 with versioning enabled to store binaries, and an S3 rollback will result in an overseer "upgrade" (actually a downgrade). #19 will add a File Fetcher, though it also just checks a single path so it still wouldn't match your workflow. Maybe the easiest thing to do is make a custom Fetcher the interface is quite simple.

from overseer.

fmpwizard avatar fmpwizard commented on June 29, 2024

yes, I'm only using overseer as a graceful restart that plays well with upstart/systemd/etc

I'll look into the Fetcher idea, I assume it means, I keep deploying to /.../<build-id, but instead of using a symlink that is created by our deployment scripts (ansible in our case), I let overseer make the actual copy of the file, interesting. I'll try it and if I run into any issues I'll post back, thanks!

from overseer.

jpillora avatar jpillora commented on June 29, 2024

Okay no worries. Note: you can also omit the fetcher to just use graceful restarts:

 	overseer.Run(overseer.Config{
 		Program: prog,
 		Address: ":3000",
 	})

Then in your app, you could poll the symlink for changes, or you could expose an HTTP endpoint, and then call overseer.Restart().

from overseer.

fmpwizard avatar fmpwizard commented on June 29, 2024

I remembered that the way our servers are setup, the actual go binary doesn't have write access to the path where it is deployed, which means I cannot go with the Fetcher idea (unless I update our folder permissions, which I would like to avoid).

Because our go app isn't the only app we run, we would like to keep ansible as the one place where deployments happen from, and keep our apps away from the deployment logic.

I ended up making these changes to proc_master.go

func (mp *master) checkBinary() error {
	// If you run your app from a synlink, you can
	// pass this env variable to set where overseer should
	// look for the binary to start a new instance
	binPath := os.Getenv(envBinPath)
	var err error
	if os.Getenv(envBinPath) == "" {
		//get path to binary and confirm its writable
		binPath, err = osext.Executable()
		if err != nil {
			return fmt.Errorf("failed to find binary path (%s)", err)
		}
	}
        mp.binPath = binPath

and now upstart passes the env variable to our go app telling it to always run from /srv/tools/web/current/<binary name>

I can keep this in our own fork if it doesn't seen aligned with your original idea for overseer.

Thanks for a great tool!

from overseer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.