Skip to content

Commit 0c4b1ed

Browse files
authored
Do minor labeler, deploy cleanup (#3927)
1 parent 0925a79 commit 0c4b1ed

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

.github/labeler.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
"backend":
1111
- changed-files:
12-
- any-glob-to-any-file:
12+
- all-globs-to-any-file:
1313
- "Backend*/**"
14+
- "!**/*.sh"
15+
- "!**/*docker*"
16+
- "!**/*Docker*"
1417

1518
"bash":
1619
- changed-files:
@@ -50,9 +53,10 @@
5053
"docker":
5154
- changed-files:
5255
- any-glob-to-any-file:
53-
- "**/.dockerignore"
56+
- "**/*docker*"
57+
- "**/*Docker*"
5458
- "**/docker_home/**"
55-
- "**/Dockerfile"
59+
- "Backend/launch.sh"
5660

5761
"documentation":
5862
- changed-files:

Backend/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ ENV APP_FILES=${HOME}/.CombineFiles
3333

3434
# Install system dependencies.
3535
RUN apt-get update \
36-
&& apt-get install -y \
37-
ffmpeg \
36+
&& apt-get install -y ffmpeg \
3837
&& rm -rf /var/lib/apt/lists/*
3938

4039
# Create the home directory for the new app user.

deploy/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ RUN apt-get update && \
1616
rm -rf /var/lib/apt/lists/*
1717

1818
# Install kubectl and helm
19-
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
19+
RUN MACH=amd64 && \
20+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${MACH}/kubectl" && \
2021
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
2122
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && \
2223
chmod 700 get_helm.sh && \

deploy/scripts/install-combine.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ install-kubernetes () {
7878
# Setup Kubernetes environment and WiFi Access Point
7979
cd ${DEPLOY_DIR}/ansible
8080

81+
# Set -e/--extra-vars for ansible-playbook
82+
EXTRA_VARS="-e k8s_user=${whoami}"
8183
if [ -d "${DEPLOY_DIR}/airgap-images" ] ; then
82-
ansible-playbook playbook_desktop_setup.yml -K -e k8s_user=`whoami` -e install_airgap_images=true $(((DEBUG == 1)) && echo "-vv")
83-
else
84-
ansible-playbook playbook_desktop_setup.yml -K -e k8s_user=`whoami` $(((DEBUG == 1)) && echo "-vv")
84+
EXTRA_VARS="${EXTRA_VARS} -e install_airgap_images=true"
8585
fi
86+
87+
ansible-playbook playbook_desktop_setup.yml -K ${EXTRA_VARS} $(((DEBUG == 1)) && echo "-vv")
8688
}
8789

8890
# Set the KUBECONFIG environment variable so that the cluster can
@@ -138,7 +140,12 @@ install-the-combine () {
138140
cd ${DEPLOY_DIR}/scripts
139141
set-combine-env
140142
set-k3s-env
141-
./setup_combine.py --tag ${COMBINE_VERSION} --repo public.ecr.aws/thecombine --target desktop ${SETUP_OPTS} $(((DEBUG == 1)) && echo "--debug")
143+
./setup_combine.py \
144+
$(((DEBUG == 1)) && echo "--debug") \
145+
--repo public.ecr.aws/thecombine \
146+
--tag ${COMBINE_VERSION} \
147+
--target desktop \
148+
${SETUP_OPTS}
142149
deactivate
143150
}
144151

deploy/scripts/package_images.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def package_images(image_list: List[str], tar_file: Path, *, debug: bool = False
7878
container_cli_cmd.extend(["--namespace", "k8s.io"])
7979

8080
# Pull each image
81+
pull_cmd = container_cli_cmd + ["pull"]
8182
for image in image_list:
82-
pull_cmd = container_cli_cmd + ["pull", image]
83-
run_cmd(pull_cmd, print_cmd=debug, print_output=debug)
83+
run_cmd(pull_cmd + [image], print_cmd=debug, print_output=debug)
8484

8585
# Save pulled images into a .tar archive
8686
save_cmd = container_cli_cmd + ["save"] + image_list + ["-o", str(tar_file)]
@@ -149,9 +149,8 @@ def package_middleware(
149149
middleware_images.append(match.group(1))
150150

151151
logging.debug(f"Middleware images: {middleware_images}")
152-
package_images(
153-
middleware_images, image_dir / "middleware-airgap-images-amd64.tar", debug=debug
154-
)
152+
out_path = image_dir / "middleware-airgap-images-amd64.tar"
153+
package_images(middleware_images, out_path, debug=debug)
155154

156155

157156
def package_thecombine(tag: str, image_dir: Path, *, debug: bool = False) -> None:
@@ -186,7 +185,8 @@ def package_thecombine(tag: str, image_dir: Path, *, debug: bool = False) -> Non
186185
logging.debug(f"Combine images: {combine_images}")
187186

188187
# Logout of AWS to allow pulling the images
189-
package_images(combine_images, image_dir / "combine-airgap-images-amd64.tar", debug=debug)
188+
out_path = image_dir / "combine-airgap-images-amd64.tar"
189+
package_images(combine_images, out_path, debug=debug)
190190

191191

192192
def main() -> None:

0 commit comments

Comments
 (0)