-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Draft: Adds services capabilities #638
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything else looks good to me!
pkg/runner/run_context.go
Outdated
const defaultNetwork = "act_github_actions_network" | ||
|
||
func (rc *RunContext) createNetwork() common.Executor { | ||
return func(ctx context.Context) error { | ||
return container.NewDockerNetworkCreateExecutor(defaultNetwork)(ctx) | ||
} | ||
} | ||
|
||
func (rc *RunContext) removeNetwork() common.Executor { | ||
return func(ctx context.Context) error { | ||
return container.NewDockerNetworkRemoveExecutor(defaultNetwork)(ctx) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If another workflow references same services, there will be a clash.
Perhaps network should be named act-<workflow-name>-network
pkg/runner/run_context.go
Outdated
c.Pull(false), | ||
c.Create(), | ||
c.Start(false), | ||
c.ConnectToNetwork(defaultNetwork), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network name clash.
pkg/runner/run_context.go
Outdated
rc.JobContainer.Create(), | ||
rc.JobContainer.Start(false), | ||
rc.JobContainer.ConnectToNetwork(defaultNetwork), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network name clash.
pkg/container/docker_network.go
Outdated
if err != nil { | ||
return err | ||
} | ||
fmt.Printf("%#v", network.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use log
instead of fmt
, we should limit fmt
only to formatting strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, it was a rogue line, my apologies
Co-authored-by: Ryan (hackercat) <me@hackerc.at>
It seems that it created 5 different
|
Yes, this was one of my concerns, I was investigating on how to have the network ID, because do the operations just with the network name is a bit flaky. I have a busy week, but if you can wait until next monday I can dig on this |
I kind of resolved it but then stuck with issue of too much IP ranges allocated |
@Markcial this pull request is now in conflict 😩 |
@Markcial this pull request has failed checks 🛠 |
thank you bot, I know that -.- |
If you get something let me know, as I can't get to it before next monday. I have an idea about using the network identifier to keep track on the networks and how to specifically remove them. But until I get some spare time I won't be able to try it. Thanks for getting some time into it |
Co-authored-by: Ryan (hackercat) <me@hackerc.at>
https://github.com/catthehacker/act-fork/tree/ticket-173 |
Well don't worry, at least it's something to check for ideas, thanks |
PR is stale and will be closed in 14 days unless there is new activity |
Fixes #173
Hi, this is a draft MR. Will need some more work
The network is created and removed by name, causing collisions, and it is created only once, I am not sure if that is the right setup, maybe it might be needed to be different on each job.
Containers and services should be included on that network, it's done here but maybe there is a better way. This MR also lacks proper testing, some advice on this would be good.
The configuration on the services are done in a hacky way, they should have properly merged environment settings, and some other configuration values.
I can help on any further changes or if you feel that someone else can't take better care of it feel free to modify it.
Thanks for this project