mirror of
https://github.com/nektos/act.git
synced 2026-04-26 17:35:49 +03:00
[GH-ISSUE #1696] Add customizable "network" option. #838
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#838
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ScionOfDesign on GitHub (Mar 24, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1696
Act version
v0.2.43
Feature description
My workflow has multiple jobs which run in parallel. In GitHub, each runner/job is on its own network. In act, however, the jobs share the same "host" network as can be seen here: https://github.com/nektos/act/blob/master/pkg/runner/run_context.go#L263
The problem is that there are many networking ports being used on the host machine, leading to intermittent port conflicts causing failures.
Passing in a new network option to a container within the workflow doesn't seem to work.
@ChristopherHX commented on GitHub (Mar 24, 2023):
Would
--container-options "--network bridge"work?@ScionOfDesign commented on GitHub (Mar 24, 2023):
I tried that and unfortunately it did not. It seems that using the host network is hard coded.
@ChristopherHX commented on GitHub (Mar 24, 2023):
Docker inspect tells me a different story on my end
my workflow
my act command
I added a sleep call to be able to find the container via docker ps and do a docker inspect.
Yes, but the
--networkflag overrides it, both configs get merged.However if your workflow looks like this than you need to add it to your yaml file for act to respect it
you need to change it to
BTW I don't like adding every docker cli option one by one to act,
--container-optionswere added for custom docker options like--network@ScionOfDesign commented on GitHub (Mar 25, 2023):
Ok thanks, that fixes my problem. I didn't realize that:
would also override the
--container-options.In fact, I thought that
--container-optionsonly applied to steps that had acontainer:attribute.@eljohnson92 commented on GitHub (Apr 10, 2023):
I've tried testing this and it seems to work adding the options to the yaml directly with ACT, but
--networkis not supported by GHA runners. it would be nice if --container-options could work even if a container image was provided