Skip to content

Commit

Permalink
xdbg docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Dec 13, 2024
1 parent cd1719f commit c686f6c
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 33 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release-xdbg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Push xdbgDocker
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64-darwin, x86_64-linux, aarch64-linux, x86_64-darwin]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v14
with:
name: xmtp
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build xdbgDocker
run: |
nix build .#packages.${{ matrix.platform }}.xdbgDocker
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Tag Docker image
run: |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:xdbg-${{ matrix.platform }}
nix path-info .#packages.${{ matrix.platform }}.xdbgDocker | xargs -I {} docker load < {}/docker-image.tar.gz
docker tag $(docker images --filter "label=org.opencontainers.image.title=xdbg" -q):latest $IMAGE_NAME
- name: Push Docker image to GHCR
run: |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:xdbg-${{ matrix.platform }}
docker push $IMAGE_NAME
38 changes: 19 additions & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
fenixPkgs = inputs'.fenix.packages;
rust-toolchain = fenixPkgs.fromToolchainFile {
file = ./rust-toolchain;
sha256 = "sha256-yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
sha256 = "sha256-s1RPtyvDGJaX/BisLT+ifVfuhDT1nZkZ1NcK8sbwELM=";
};

pkgConfig = {
Expand Down Expand Up @@ -84,6 +84,7 @@
libFileSetForWorkspace
fileSetForCrate;
};

xdbg = import ./nix/xdbg {
inherit pkgs craneLib filesets;
};
Expand Down
6 changes: 3 additions & 3 deletions nix/mls_validation_service/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ let
rustTarget = "x86_64-unknown-linux-musl";
};

dockerImage = pkgs.dockerTools.streamLayeredImage {
name = "xmtp/mls_validation_service";
dockerImage = pkgs.dockerTools.buildImage {
name = "xmtp/mls-validation-service";
tag = "latest";
contents = [ muslService.bin ];
config = {
Cmd = [ "${muslService.bin}/bin/mls_validation_service" ];
Cmd = [ "${muslService.bin}/bin/mls-validation-service" ];
};
};
in
Expand Down
14 changes: 5 additions & 9 deletions nix/xdbg/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{
pkgs,
craneLib,
filesets,
}:
{ pkgs, craneLib, filesets }:
let
xdbg = pkgs.callPackage ./crate.nix { inherit craneLib filesets; };
muslXDbg = pkgs.pkgsCross.musl64.callPackage ./crate.nix {
inherit craneLib filesets;
rustTarget = "x86_64-unknown-linux-musl";
inherit craneLib filesets; rustTarget = "x86_64-unknown-linux-musl";
};

dockerImage = pkgs.dockerTools.streamLayeredImage {
dockerImage = pkgs.dockerTools.buildImage {
name = "xmtp/xdbg";
tag = "latest";
contents = [ muslXDbg.bin ];
copyToRoot = [ muslXDbg.bin ];
config = {
Cmd = [ "${muslXDbg.bin}/bin/xdbg" ];
};
Expand All @@ -25,3 +20,4 @@ in
inherit muslXDbg;
inherit dockerImage;
}

1 change: 0 additions & 1 deletion nix/xdbg/result

This file was deleted.

0 comments on commit c686f6c

Please sign in to comment.