Skip to content

Commit

Permalink
Modified make build process to use --build-arg instead of generate.sh…
Browse files Browse the repository at this point in the history
… scripts, eliminating the templates. (#1656)

* Modified make build process to use --build-arg instead of generate.sh scripts. Removed unneeded txt files and sh files.

* Modified test.py to include the FROM_IMAGE_ARGS when building the images using the Docker SDK for Python

* Added FROM_IMAGE_ARGS to test.py and the base for FROM_IMAGE_ARGS for the Standalone browser container images. Resolved a warning caused by the Base and video Dockerfiles not needing the FROM_IMAGE_ARGS.

Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
jamesmortensen and diemol authored Aug 17, 2022
1 parent fe89258 commit 7010a13
Show file tree
Hide file tree
Showing 44 changed files with 128 additions and 919 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,5 @@ ENV/
/site

# End of https://www.gitignore.io/api/python
.DS_Store

11 changes: 5 additions & 6 deletions Distributor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.4.0-20220812
LABEL authors=SeleniumHQ
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
LABEL authors=${AUTHORS}

USER 1200

Expand Down
12 changes: 0 additions & 12 deletions Distributor/Dockerfile.txt

This file was deleted.

14 changes: 0 additions & 14 deletions Distributor/generate.sh

This file was deleted.

11 changes: 5 additions & 6 deletions EventBus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.4.0-20220812
LABEL authors=SeleniumHQ
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
LABEL authors=${AUTHORS}

USER 1200

Expand Down
17 changes: 0 additions & 17 deletions EventBus/Dockerfile.txt

This file was deleted.

14 changes: 0 additions & 14 deletions EventBus/generate.sh

This file was deleted.

11 changes: 5 additions & 6 deletions Hub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.4.0-20220812
LABEL authors=SeleniumHQ
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
LABEL authors=${AUTHORS}

USER 1200

Expand Down
21 changes: 0 additions & 21 deletions Hub/Dockerfile.txt

This file was deleted.

14 changes: 0 additions & 14 deletions Hub/generate.sh

This file was deleted.

138 changes: 31 additions & 107 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ TAG_VERSION := $(VERSION)-$(BUILD_DATE)
NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME))
AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ)
PUSH_IMAGE := $(or $(PUSH_IMAGE),$(PUSH_IMAGE),false)
FROM_IMAGE_ARGS := --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(TAG_VERSION) --build-arg AUTHORS=$(AUTHORS)
BUILD_ARGS := $(BUILD_ARGS)
MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION)))
MINOR := $(word 2,$(subst ., ,$(TAG_VERSION)))
Expand All @@ -28,22 +29,6 @@ all: hub \
standalone_docker \
video

generate_all: \
generate_hub \
generate_distributor \
generate_router \
generate_sessions \
generate_sessionqueue \
generate_event_bus \
generate_node_base \
generate_chrome \
generate_edge \
generate_firefox \
generate_docker \
generate_standalone_firefox \
generate_standalone_chrome \
generate_standalone_edge \
generate_standalone_docker

build: all

Expand All @@ -52,95 +37,50 @@ ci: build test
base:
cd ./Base && docker build $(BUILD_ARGS) -t $(NAME)/base:$(TAG_VERSION) .

generate_hub:
cd ./Hub && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
hub: base
cd ./Hub && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) .

hub: base generate_hub
cd ./Hub && docker build $(BUILD_ARGS) -t $(NAME)/hub:$(TAG_VERSION) .
distributor: base
cd ./Distributor && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) .

generate_distributor:
cd ./Distributor && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
router: base
cd ./Router && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/router:$(TAG_VERSION) .

distributor: base generate_distributor
cd ./Distributor && docker build $(BUILD_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) .
sessions: base
cd ./Sessions && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) .

generate_router:
cd ./Router && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
sessionqueue: base
cd ./SessionQueue && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) .

router: base generate_router
cd ./Router && docker build $(BUILD_ARGS) -t $(NAME)/router:$(TAG_VERSION) .
event_bus: base
cd ./EventBus && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) .

generate_sessions:
cd ./Sessions && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
node_base: base
cd ./NodeBase && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) .

sessions: base generate_sessions
cd ./Sessions && docker build $(BUILD_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) .
chrome: node_base
cd ./NodeChrome && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chrome:$(TAG_VERSION) .

generate_sessionqueue:
cd ./SessionQueue && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
edge: node_base
cd ./NodeEdge && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-edge:$(TAG_VERSION) .

sessionqueue: base generate_sessionqueue
cd ./SessionQueue && docker build $(BUILD_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) .
firefox: node_base
cd ./NodeFirefox && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) .

generate_event_bus:
cd ./EventBus && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
docker: base
cd ./NodeDocker && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) .

event_bus: base generate_event_bus
cd ./EventBus && docker build $(BUILD_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) .
standalone_docker: docker
cd ./StandaloneDocker && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) .

generate_node_base:
cd ./NodeBase && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)
standalone_firefox: firefox
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) .

node_base: base generate_node_base
cd ./NodeBase && docker build $(BUILD_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) .
standalone_chrome: chrome
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:$(TAG_VERSION) .

generate_chrome:
cd ./NodeChrome && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

chrome: node_base generate_chrome
cd ./NodeChrome && docker build $(BUILD_ARGS) -t $(NAME)/node-chrome:$(TAG_VERSION) .

generate_edge:
cd ./NodeEdge && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

edge: node_base generate_edge
cd ./NodeEdge && docker build $(BUILD_ARGS) -t $(NAME)/node-edge:$(TAG_VERSION) .

generate_firefox:
cd ./NodeFirefox && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

firefox: node_base generate_firefox
cd ./NodeFirefox && docker build $(BUILD_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) .

generate_docker:
cd ./NodeDocker && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

docker: base generate_docker
cd ./NodeDocker && docker build $(BUILD_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) .

generate_standalone_docker:
cd ./StandaloneDocker && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

standalone_docker: docker generate_standalone_docker
cd ./StandaloneDocker && docker build $(BUILD_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) .

generate_standalone_firefox:
cd ./Standalone && ./generate.sh StandaloneFirefox node-firefox $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

standalone_firefox: firefox generate_standalone_firefox
cd ./StandaloneFirefox && docker build $(BUILD_ARGS) -t $(NAME)/standalone-firefox:$(TAG_VERSION) .

generate_standalone_chrome:
cd ./Standalone && ./generate.sh StandaloneChrome node-chrome $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

standalone_chrome: chrome generate_standalone_chrome
cd ./StandaloneChrome && docker build $(BUILD_ARGS) -t $(NAME)/standalone-chrome:$(TAG_VERSION) .

generate_standalone_edge:
cd ./Standalone && ./generate.sh StandaloneEdge node-edge $(TAG_VERSION) $(NAMESPACE) $(AUTHORS)

standalone_edge: edge generate_standalone_edge
cd ./StandaloneEdge && docker build $(BUILD_ARGS) -t $(NAME)/standalone-edge:$(TAG_VERSION) .
standalone_edge: edge
cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -t $(NAME)/standalone-edge:$(TAG_VERSION) .

video:
cd ./Video && docker build $(BUILD_ARGS) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) .
Expand Down Expand Up @@ -394,22 +334,6 @@ test_video: video hub chrome firefox edge
edge \
firefox \
docker \
generate_all \
generate_hub \
generate_distributor \
generate_router \
generate_sessions \
generate_sessionqueue \
generate_event_bus \
generate_node_base \
generate_chrome \
generate_edge \
generate_firefox \
generate_docker \
generate_standalone_chrome \
generate_standalone_edge \
generate_standalone_firefox \
generate_standalone_docker \
hub \
distributor \
router \
Expand Down
11 changes: 5 additions & 6 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:4.4.0-20220812
LABEL authors=SeleniumHQ
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
LABEL authors=${AUTHORS}

USER root

Expand Down
Loading

0 comments on commit 7010a13

Please sign in to comment.