Skip to content

readme: add self-hosted runners and container jobs #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,39 @@ jobs:
env:
TARANTOOL_CACHE_KEY_SUFFIX: -DA-${{ matrix.image }}-${{ github.run_id }}
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC

steps:
- name: Setup system
- name: Configure apt-get
run: |
mkdir -p /etc/apt/apt.conf.d
printf '%s\n%s\n' \
'APT::Install-Recommends "false";' \
'APT::Install-Suggests "false";' \
> /etc/apt/apt.conf.d/no-recommends-no-suggests.conf

- name: Update repositories metadata
run: |
apt-get -y update
apt-get -y upgrade
apt-get -y install --no-install-recommends --no-install-suggests \
tzdata sudo lsb-release gnupg ca-certificates rsync

- name: Setup nodejs
uses: actions/setup-node@v3
- name: Workaround interactive tzdata configuration problem (gh-50)
run:
apt-get -y install tzdata

- name: Install setup-tarantool dependencies
run: |
apt-get -y install sudo lsb-release gnupg ca-certificates rsync

# Bring `node` executable file into PATH for latest-version
# and verify-versions actions.
#
# It is not needed for a usual usage of the setup-tarantool
# action within a container job, because GitHub Action
# runner mounts a volume with a `node` executable into the
# container.
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.18.0'
node-version: 20

- uses: actions/checkout@v4

Expand Down
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ This action will set up [Tarantool](https://www.tarantool.io) environment and **

- When cached, it takes \~1-2s to finish.
- The first run takes \~40s.
- Cache size is \~20MB.
- Runs on GitHub-hosted `ubuntu-*` runners only.
- Cache size is 20MB-30MB.
- Runs on GitHub-hosted `ubuntu-*` runners.
- Runs on Debian/Ubuntu self-hosted runners.
- Runs inside Debian/Ubuntu container jobs.

# Usage

Expand Down Expand Up @@ -47,6 +49,51 @@ steps:
nightly-build: true
```

### Self-hosted runners and container jobs

It requires an additional step to bring dependencies needed for the action
itself. These dependencies are preinstalled on GitHub hosted runners, but a
self-hosted runner and a docker image may miss them.

Configuring `apt-get` to skip recommended and suggested packages reduces the
cache size from \~200MiB to \~30MiB.

```yaml
jobs:
myjob:
runs-on: ubuntu-latest
container:
image: debian:bookworm

env:
DEBIAN_FRONTEND: noninteractive

steps:
- name: Configure apt-get
run: |
mkdir -p /etc/apt/apt.conf.d
printf '%s\n%s\n' \
'APT::Install-Recommends "false";' \
'APT::Install-Suggests "false";' \
> /etc/apt/apt.conf.d/no-recommends-no-suggests.conf

- name: Update repositories metadata
run: |
apt-get -y update

- name: Workaround interactive tzdata configuration problem (gh-50)
run:
apt-get -y install tzdata

- name: Install setup-tarantool dependencies
run: |
apt-get -y install sudo lsb-release gnupg ca-certificates rsync

- uses: tarantool/setup-tarantool@ab69f5679e6ea7e5872d9e0901f681587fd29be6
with:
tarantool-version: '2.11'
```

# License

The scripts and documentation in this project are released under the [MIT License](LICENSE).
Expand Down