Skip to content

ci: use Valkey (Redis-compatible server) as storage backend for ccache. Add Tailscale to access the private Valkey server#11363

Closed
esteve wants to merge 7 commits intoautowarefoundation:mainfrom
esteve:use-valkey-ccache-storage
Closed

ci: use Valkey (Redis-compatible server) as storage backend for ccache. Add Tailscale to access the private Valkey server#11363
esteve wants to merge 7 commits intoautowarefoundation:mainfrom
esteve:use-valkey-ccache-storage

Conversation

@esteve
Copy link
Copy Markdown
Contributor

@esteve esteve commented Sep 12, 2025

Description

This PR adds support for using Valkey (a Redis-compatible implementation) with ccache. Additionally, it uses Tailscale to access the Valkey server, as it's not recommended to expose it to the internet, not even with a password.

Related links

Parent Issue:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions Bot added the type:ci Continuous Integration (CI) processes and testing. (auto-assigned) label Sep 12, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 12, 2025

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@esteve esteve added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Sep 12, 2025
@esteve esteve force-pushed the use-valkey-ccache-storage branch 2 times, most recently from 65e30e3 to 35b6e62 Compare September 13, 2025 19:00
@esteve esteve force-pushed the use-valkey-ccache-storage branch from 35b6e62 to cda471c Compare September 28, 2025 16:03
@esteve
Copy link
Copy Markdown
Contributor Author

esteve commented Sep 28, 2025

The approach taken in this PR involves the following components:

  • Valkey (https://valkey.io/) as a remote backend storage for ccache. Valkey is a Redis-compatible server that offers extra functionality such as multithreaded IO. Valkey started as a fork of Redis when the latter changed its license to a non-opensource license (Redis has reverted to an OSI-approved license since then).
  • Tailscale (https://tailscale.com/) as a mechanism for connecting the public GitHub runners with our private server. Tailscale is a VPN service that provides really low latency and flexible workflows for ephermeral clients (e.g. GitHub runners).

The diagram is as follows:

valkey_tailscale drawio

The rationale for using Tailscale is that the developers of Redis themselves advise strongly against exposing Redis (and Valkey) to the internet, even if they are protected by a password (see https://valkey.io/topics/security/ and https://redis.io/docs/latest/operate/oss_and_stack/management/security/).

On our server, Tailscale runs as a Docker container to both provide an extra layer of isolation and as straightforward way to deploy it without installing extra packages. The Docker container for Tailscale is set up as a systemd service, so that systemd can monitor it and restart it when necessary. Additionally, the Tailscale service is not running on the same network as the host, but on a separate Docker network, to provide extra isolation.

Valkey also runs as a Docker container, and instead of exposing its port (6379) to the host, it is running on the same network as Tailscale, so that only VPN clients can actually access Valkey and not any untrusted client. This is achieved by passing the option --network="container:docker.tailscale.service", where docker.tailscale.service is the name of the systemd service running the Tailscale container.

On the GitHub side, Tailscale provides a GitHub action (https://tailscale.com/kb/1276/tailscale-github-action) that can be used to connect to a Tailscale network. This action requires either the use of an auth_key or OAuth authentication, and the nodes marked as ephemeral so that the GitHub runners' keys are deleted when no longer in use.

@esteve esteve force-pushed the use-valkey-ccache-storage branch from cda471c to d53b6ee Compare October 21, 2025 13:25
@esteve esteve force-pushed the use-valkey-ccache-storage branch from d53b6ee to 3ba59c9 Compare November 9, 2025 16:10
…e. Add Tailscale to access the private Valkey server

Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
@esteve esteve force-pushed the use-valkey-ccache-storage branch from 3ba59c9 to c7e84ce Compare November 11, 2025 13:16
@esteve
Copy link
Copy Markdown
Contributor Author

esteve commented Nov 25, 2025

Closing this PR as we're not any longer exploring the use of Valkey

@esteve esteve closed this Nov 25, 2025
@github-project-automation github-project-automation Bot moved this from To Triage to Done in Software Working Group Nov 25, 2025
@esteve esteve deleted the use-valkey-ccache-storage branch November 25, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:ci Continuous Integration (CI) processes and testing. (auto-assigned)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant