From e02e6bff4440211272047c87a97147ceaf918b78 Mon Sep 17 00:00:00 2001 From: Jamie Bertram Date: Fri, 17 Mar 2023 10:35:43 -0400 Subject: [PATCH] Update OCI images to point to GHCR --- deploy/oci-images.nix | 82 +++++++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/deploy/oci-images.nix b/deploy/oci-images.nix index 71bf0cd201..df7299f77f 100644 --- a/deploy/oci-images.nix +++ b/deploy/oci-images.nix @@ -1,46 +1,74 @@ { inputs }: let inherit (inputs) std self nixpkgs; - inherit (nixpkgs.lib) removePrefix mapAttrsToList; + inherit (nixpkgs.lib) removePrefix mapAttrsToList mapAttrs; inherit (nixpkgs.lib.strings) concatMapStrings; inherit (self) operables; inherit (self.sourceInfo) lastModifiedDate; - mkImage = name: - let - tagName = removePrefix "marlowe-" name; - tagDate = builtins.substring 0 8 lastModifiedDate; # pull out just date - in + mkImage = { operable, description, name ? operable }: tag: std.lib.ops.mkStandardOCI { - name = "iohkbuild/marlowe"; - tag = "${tagName}-${tagDate}"; - operable = operables.${name}; + inherit tag; + name = "ghcr.io/input-output-hk/${name}"; + operable = operables.${operable}; uid = "0"; gid = "0"; + labels = { + inherit description; + source = "https://github.com/input-output-hk/marlowe-cardano"; + license = "Apache-2.0"; + }; }; images = { - chain-indexer = mkImage "chain-indexer"; - marlowe-chain-sync = mkImage "marlowe-chain-sync"; - marlowe-indexer = mkImage "marlowe-indexer"; - marlowe-sync = mkImage "marlowe-sync"; - marlowe-tx = mkImage "marlowe-tx"; - marlowe-proxy = mkImage "marlowe-proxy"; - marlowe-web-server = mkImage "marlowe-web-server"; + chain-indexer = mkImage { + operable = "chain-indexer"; + name = "marlowe-chain-indexer"; + description = "A Cardano chain indexer for the Marlowe Runtime"; + }; + marlowe-chain-sync = mkImage { + operable = "marlowe-chain-sync"; + description = "A Cardano chain sync and query service for the Marlowe Runtime."; + }; + marlowe-indexer = mkImage { + operable = "marlowe-indexer"; + description = "A Marlowe contract indexing service for the Marlowe Runtime."; + }; + marlowe-sync = mkImage { + operable = "marlowe-sync"; + description = "A Marlowe contract synchronization and query service for the Marlowe Runtime."; + }; + marlowe-tx = mkImage { + operable = "marlowe-tx"; + description = "A Marlowe transaction creation service for the Marlowe Runtime."; + }; + marlowe-proxy = mkImage { + operable = "marlowe-proxy"; + description = "An API Gateway service for the Marlowe Runtime."; + }; + marlowe-web-server = mkImage { + operable = "marlowe-web-server"; + description = "An HTTP server for the Marlowe Runtime, exposing a REST API."; + }; }; - forAllImages = f: concatMapStrings (s: s + "\n") (mapAttrsToList (_: f) images); -in -images // { + forAllImages = f: tag: concatMapStrings + (s: s + "\n") + (mapAttrsToList (_: img: f (img tag)) images); - all = { - copyToDockerDaemon = std.lib.ops.writeScript { - name = "copy-to-docker-daemon"; - text = forAllImages (img: "${img.copyToDockerDaemon}/bin/copy-to-docker-daemon"); - }; - copyToRegistry = std.lib.ops.writeScript { - name = "copy-to-registry"; - text = forAllImages (img: "${img.copyToRegistry}/bin/copy-to-registry"); + mkImages = tag: (mapAttrs (_: img: img tag) images) // { + all = { + copyToDockerDaemon = std.lib.ops.writeScript { + name = "copy-to-docker-daemon"; + text = forAllImages (img: "${img.copyToDockerDaemon}/bin/copy-to-docker-daemon") tag; + }; + copyToRegistry = std.lib.ops.writeScript { + name = "copy-to-registry"; + text = forAllImages (img: "${img.copyToRegistry}/bin/copy-to-registry") tag; + }; }; }; +in +{ + latest = mkImages "latest"; }