Best Practices for CI/CD w Rivet

I'm looking to add a CI/CD pipeline for my Rivet Unreal project. I already have my Unreal Linux server to Docker process sorted so my only remaining work is really around deployment. Are there any best practices I should know about for submitting deployments to Rivet? Topics that come to mind: - build agent auth - removing older deployments over time - naming conventions - docker image size - rate limits on upload frequency
6 Replies
Nathan
Nathan2y ago
hey! the rivet cli can auto-genrate a gh actions script based on your rivet.yaml. details here – https://rivet.gg/docs/general/concepts/cli-tips#continuous-integration all you need is to add a cloud token to the RIVET_TOKEN secret (see ss #1)
build agent auth
the rivet cli handles all auth for you.
removing older deployments over time
currently no system for this, rivet is eating the cost. we'll email you with a heads up if this changes.
naming conventions
rivet auto-names versions/builds for you (see ss #2). you can override this with what works best for you.
docker image size
current max size is 8 gb. lmk if this is too low for you all.
rate limits on upload frequency
currently 16 uploads per 15 min. this might need to be increased too.
No description
No description
Zhymon
ZhymonOP2y ago
awesome thanks for the link @Nathan ! One follow up question @Nathan are there any plans to support podman or podman-desktop in the future? When I attempted to build images previously with podman I had issues with the moby/buildkit . I didn't dig into it to much at the time.
Nathan
Nathan2y ago
interesting, have not heard about issues like this before. it wouldn't be hard to support. can you give a bit more context on what type of project it was failing with so i can try and reproduce?
Zhymon
ZhymonOP2y ago
Unreal engine, I need to double check that if i was using the rivet-cli provided dockerfiles or not. I've started using my own dockerfiles as i didn't want to bother with the overhead of epics builder images as I'm using unreal engine from source so building dedicated servers doesn't need that step.
Nathan
Nathan2y ago
gotcha. feel free to send over a dockerfile here or in dm if you'd like.
Zhymon
ZhymonOP2y ago
okay think I managed to remember (this was a while ago so forgive my poor memory) where this came into play, the rivet build command. https://github.com/rivet-gg/cli/blob/main/cli/src/commands/docker/build.rs . I believe using buildx/buildkit (at least last time I looked) wasnt fully supported in podman yet. looks like that has been resolved in recent releases to podman. I most likely wont revist this for a while. got a lot to do between now and release. Also looks like there may be a flag to use the native build rather than buildx/buildkit with rivet dockerfile example from my project:
# Copy files from builder
FROM debian:11-slim

# Set env vars
ENV RIVET_TOKEN="pub_prod.<>"
ENV DOPPLER_URL="<>"
ENV DOPPLER_TOKEN="<>"

# Install expect package for 'unbuffer' utility, `xdg-user-dir` to fix Unreal error
RUN apt-get update && apt-get upgrade -y && apt install -y expect xdg-user-dirs

# Create user
RUN useradd nonroot
USER nonroot

# Copy packaged game server
COPY --chown=nonroot:nonroot /ArchivedBuilds/LinuxServer/ /home/nonroot/project

# Expose the game server port
EXPOSE 7777/udp

# Run the game server
ENTRYPOINT ["/home/nonroot/project/Project24Server.sh", "-ini:Engine:[EpicOnlineServices]:DedicatedServerClientId=<>", "-ini:Engine:[EpicOnlineServices]:DedicatedServerClientSecret=<>","-ini:Engine:[EpicOnlineServices]:NetworkAuthenticationMode=Off", "-server", "-log"]
# Copy files from builder
FROM debian:11-slim

# Set env vars
ENV RIVET_TOKEN="pub_prod.<>"
ENV DOPPLER_URL="<>"
ENV DOPPLER_TOKEN="<>"

# Install expect package for 'unbuffer' utility, `xdg-user-dir` to fix Unreal error
RUN apt-get update && apt-get upgrade -y && apt install -y expect xdg-user-dirs

# Create user
RUN useradd nonroot
USER nonroot

# Copy packaged game server
COPY --chown=nonroot:nonroot /ArchivedBuilds/LinuxServer/ /home/nonroot/project

# Expose the game server port
EXPOSE 7777/udp

# Run the game server
ENTRYPOINT ["/home/nonroot/project/Project24Server.sh", "-ini:Engine:[EpicOnlineServices]:DedicatedServerClientId=<>", "-ini:Engine:[EpicOnlineServices]:DedicatedServerClientSecret=<>","-ini:Engine:[EpicOnlineServices]:NetworkAuthenticationMode=Off", "-server", "-log"]
GitHub
cli/cli/src/commands/docker/build.rs at main · rivet-gg/cli
Contribute to rivet-gg/cli development by creating an account on GitHub.

Did you find this page helpful?