Skip to content

Commit b5dfdaf

Browse files
committed
Simplifies Dockerfile and fix GitHub runner space
Simplifies the Dockerfile as Python 2 was dropped. Renames to default "Dockerfile" so it's picked up by docker hub automatically. This is a follow-up for: kivy#2105 Adds the GitHub action build badge. Free up space before building the APKs to avoid the GitHub Action runner being full. The error was: ``` mkdir -p /home/user/.android/android-ndk-r19b \ && unzip -q android-ndk-r19b-linux-x86_64.zip -d /home/user/.android \ && ln -sfn /home/user/.android/android-ndk-r19b /home/user/.android/android-ndk \ && rm -f android-ndk-r19b-linux-x86_64.zip Error processing tar file(exit status 1): write /home/user/.android/android-ndk-r19b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/bfd-plugins/LLVMgold.so: no space left on device Makefile:61: recipe for target 'docker/build' failed make: *** [docker/build] Error 1 ```` https://github.com/kivy/python-for-android/actions/runs/81658805 The "Free disk space" step could clear about ~10G and helped making the build pass. See output logs for details.
1 parent 265fe7f commit b5dfdaf

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.github/workflows/push.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ jobs:
5252
steps:
5353
- name: Checkout python-for-android
5454
uses: actions/checkout@v2
55+
# helps with GitHub runner getting out of space
56+
- name: Free disk space
57+
run: |
58+
df -h
59+
sudo swapoff -a
60+
sudo rm -f /swapfile
61+
sudo apt -y clean
62+
docker rmi $(docker image ls -aq)
63+
df -h
5564
- name: Pull docker image
5665
run: |
5766
make docker/pull
@@ -75,6 +84,15 @@ jobs:
7584
uses: actions/checkout@v2
7685
with:
7786
ref: 'develop'
87+
# helps with GitHub runner getting out of space
88+
- name: Free disk space
89+
run: |
90+
df -h
91+
sudo swapoff -a
92+
sudo rm -f /swapfile
93+
sudo apt -y clean
94+
docker rmi $(docker image ls -aq)
95+
df -h
7896
- name: Pull docker image
7997
run: |
8098
make docker/pull

Dockerfile.py3 renamed to Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# - python-for-android dependencies
44
#
55
# Build with:
6-
# docker build --tag=p4a --file Dockerfile.py3 .
6+
# docker build --tag=p4a --file Dockerfile .
77
#
88
# Run with:
99
# docker run -it --rm p4a /bin/sh -c '. venv/bin/activate && p4a apk --help'
@@ -71,8 +71,6 @@ RUN dpkg --add-architecture i386 \
7171
openjdk-8-jdk \
7272
patch \
7373
pkg-config \
74-
python \
75-
python-pip \
7674
python3 \
7775
python3-dev \
7876
python3-pip \
@@ -95,10 +93,6 @@ RUN useradd --create-home --shell /bin/bash ${USER}
9593
RUN usermod -append --groups sudo ${USER}
9694
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
9795

98-
# install cython for python 2 (for python 3 it's inside the venv)
99-
RUN pip2 install --upgrade Cython==0.28.6 \
100-
&& rm -rf ~/.cache/
101-
10296
WORKDIR ${WORK_DIR}
10397
RUN mkdir ${ANDROID_HOME} && chown --recursive ${USER} ${HOME_DIR} ${ANDROID_HOME}
10498
USER ${USER}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker/pull:
5858
docker pull $(DOCKER_IMAGE):latest || true
5959

6060
docker/build:
61-
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) --file=Dockerfile.py3 .
61+
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) .
6262

6363
docker/push:
6464
docker push $(DOCKER_IMAGE)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ python-for-android
22
==================
33

44
[![Build Status](https://travis-ci.org/kivy/python-for-android.svg?branch=develop)](https://travis-ci.org/kivy/python-for-android)
5+
[![Unit tests & build apps](https://github.com/kivy/python-for-android/workflows/Unit%20tests%20&%20build%20apps/badge.svg?branch=develop)](https://github.com/kivy/python-for-android/actions?query=workflow%3A%22Unit+tests+%26+build+apps%22)
56
[![Coverage Status](https://coveralls.io/repos/github/kivy/python-for-android/badge.svg?branch=develop&kill_cache=1)](https://coveralls.io/github/kivy/python-for-android?branch=develop)
67
[![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers)
78
[![Sponsors on Open Collective](https://opencollective.com/kivy/sponsors/badge.svg)](#sponsors)

0 commit comments

Comments
 (0)