Skip to content

Commit 8b5516c

Browse files
authored
arm64 image (#79)
* Update packages. Enable arm64 builds Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> --------- Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 57427bf commit 8b5516c

File tree

4 files changed

+577
-526
lines changed

4 files changed

+577
-526
lines changed

.github/workflows/containers.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
tags:
88
- 'v*'
99
workflow_dispatch: # allow to manually trigger this workflow
10+
pull_request:
1011

1112
env:
1213
REGISTRY: ghcr.io
@@ -42,6 +43,10 @@ jobs:
4243
uses: actions/setup-node@v4
4344
with:
4445
node-version: '21.x'
46+
- name: Trim CI agent
47+
run: |
48+
chmod +x ci/free_disk_space.sh
49+
./ci/free_disk_space.sh
4550
- name: Delete `.rustup` directory
4651
run: rm -rf /home/runner/.rustup # to save disk space
4752
if: runner.os == 'Linux'
@@ -105,7 +110,7 @@ jobs:
105110
with:
106111
file: ci/Dockerfile
107112
context: .
108-
platforms: linux/amd64
113+
platforms: linux/amd64,linux/arm64
109114
push: true
110115
tags: ${{ steps.meta.outputs.tags }}
111116
labels: ${{ steps.meta.outputs.labels }}

ci/Dockerfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM almalinux:9.3-minimal
1+
FROM almalinux:9.4-minimal
22

33
LABEL maintainer="appthreat" \
44
org.opencontainers.image.authors="Team AppThreat <cloud@appthreat.com>" \
@@ -58,7 +58,7 @@ RUN set -e; \
5858
&& microdnf install -y gcc git-core php php-cli php-curl php-zip php-bcmath php-json php-pear php-mbstring php-devel make wget bash graphviz graphviz-gd \
5959
pcre2 findutils which tar gzip zip unzip sudo nodejs ncurses sqlite-devel glibc-common glibc-all-langpacks \
6060
&& mkdir -p /opt/miniconda3 /opt/workspace \
61-
&& wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /opt/miniconda3/miniconda.sh \
61+
&& wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-${ARCH_NAME}.sh -O /opt/miniconda3/miniconda.sh \
6262
&& bash /opt/miniconda3/miniconda.sh -b -u -p /opt/miniconda3 \
6363
&& rm -rf /opt/miniconda3/miniconda.sh \
6464
&& ln -s /opt/miniconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
@@ -69,9 +69,9 @@ RUN set -e; \
6969
&& conda config --set solver libmamba \
7070
&& conda init bash \
7171
&& bash -c /opt/conda-install.sh \
72-
&& curl -LO https://repo.almalinux.org/almalinux/9/CRB/${ARCH_NAME}/os/Packages/graphviz-devel-2.44.0-25.el9.${ARCH_NAME}.rpm \
73-
&& rpm -ivh graphviz-devel-2.44.0-25.el9.${ARCH_NAME}.rpm \
74-
&& rm graphviz-devel-2.44.0-25.el9.${ARCH_NAME}.rpm \
72+
&& curl -LO https://repo.almalinux.org/almalinux/9/CRB/${ARCH_NAME}/os/Packages/graphviz-devel-2.44.0-26.el9.${ARCH_NAME}.rpm \
73+
&& rpm -ivh graphviz-devel-2.44.0-26.el9.${ARCH_NAME}.rpm \
74+
&& rm graphviz-devel-2.44.0-26.el9.${ARCH_NAME}.rpm \
7575
&& curl -s "https://get.sdkman.io" | bash \
7676
&& source "$HOME/.sdkman/bin/sdkman-init.sh" \
7777
&& echo -e "sdkman_auto_answer=true\nsdkman_selfupdate_feature=false\nsdkman_auto_env=true\nsdkman_curl_connect_timeout=20\nsdkman_curl_max_time=0" >> $HOME/.sdkman/etc/config \
@@ -83,14 +83,14 @@ RUN set -e; \
8383
&& rm -rf /root/.sdkman \
8484
&& microdnf install -y epel-release \
8585
&& mkdir -p ${ANDROID_HOME}/cmdline-tools \
86-
&& curl -L https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o ${ANDROID_HOME}/cmdline-tools/android_tools.zip \
86+
&& curl -L https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o ${ANDROID_HOME}/cmdline-tools/android_tools.zip \
8787
&& unzip ${ANDROID_HOME}/cmdline-tools/android_tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \
8888
&& rm ${ANDROID_HOME}/cmdline-tools/android_tools.zip \
8989
&& mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \
9090
&& yes | /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses --sdk_root=/opt/android-sdk-linux \
9191
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platform-tools' --sdk_root=/opt/android-sdk-linux \
92-
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platforms;android-33' --sdk_root=/opt/android-sdk-linux \
93-
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'build-tools;33.0.0' --sdk_root=/opt/android-sdk-linux \
92+
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platforms;android-34' --sdk_root=/opt/android-sdk-linux \
93+
&& /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'build-tools;34.0.0' --sdk_root=/opt/android-sdk-linux \
9494
&& sudo npm install -g @appthreat/atom @cyclonedx/cdxgen --omit=optional \
9595
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php \
9696
&& mv composer.phar /usr/local/bin/composer

ci/free_disk_space.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
#
19+
# The Azure provided machines typically have the following disk allocation:
20+
# Total space: 85GB
21+
# Allocated: 67 GB
22+
# Free: 17 GB
23+
# This script frees up 28 GB of disk space by deleting unneeded packages and
24+
# large directories.
25+
# The Flink end to end tests download and generate more than 17 GB of files,
26+
# causing unpredictable behavior and build failures.
27+
#
28+
echo "=============================================================================="
29+
echo "Freeing up disk space on CI system"
30+
echo "=============================================================================="
31+
32+
echo "Listing 100 largest packages"
33+
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
34+
df -h
35+
echo "Removing large packages"
36+
sudo apt-get remove -y '^dotnet-.*'
37+
sudo apt-get remove -y '^llvm-.*'
38+
sudo apt-get remove -y '^mongodb-.*'
39+
sudo apt-get remove -y '^mysql-.*'
40+
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
41+
sudo apt-get autoremove -y
42+
sudo apt-get clean
43+
df -h
44+
echo "Removing large directories"
45+
46+
sudo rm -rf /usr/share/dotnet/
47+
sudo rm -rf /usr/local/graalvm/
48+
sudo rm -rf /usr/local/.ghcup/
49+
sudo rm -rf /usr/local/share/powershell
50+
sudo rm -rf /usr/local/share/chromium
51+
df -h

0 commit comments

Comments
 (0)