Skip to content

Commit

Permalink
minio: add legacy fs version 2022-10-24T18-35-07Z (#206376)
Browse files Browse the repository at this point in the history
* minio: add legacy fs version 2022-10-24T18-35-07Z

This allows users to migrate their data to versions that already removed
support for the legacy fs backend.

* Update nixos/doc/manual/release-notes/rl-2305.section.md

Co-authored-by: Florian Klink <flokli@flokli.de>
  • Loading branch information
bachp and flokli authored Dec 23, 2022
1 parent b87dd43 commit 8127165
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
20 changes: 20 additions & 0 deletions nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@
<literal>fetch-ec2-metadata.service</literal>
</para>
</listitem>
<listitem>
<para>
<literal>minio</literal> removed support for it’s legacy
filesystem backend in
<link xlink:href="https://github.com/minio/minio/releases/tag/RELEASE.2022-10-29T06-21-33Z">RELEASE.2022-10-29T06-21-33Z</link>.
This means if your storage was created with the old format,
minio will no longer start. Unfortunately minio doesn’t
provide a an automatic migration, they only provide
<link xlink:href="https://min.io/docs/minio/windows/operations/install-deploy-manage/migrate-fs-gateway.html">instructions
how to manually convert the node</link>. To facilitate this
migration we keep around the last version that still supports
the old filesystem backend as
<literal>minio_legacy_fs</literal>. Use it via
<literal>services.minio.package = minio_legacy_fs;</literal>
to export your data before switching to the new version. See
the corresponding <link xlink:href="">issue</link>
https://github.com/NixOS/nixpkgs/issues/199318) for more
details.
</para>
</listitem>
<listitem>
<para>
<literal>services.sourcehut.dispatch</literal> and the
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2305.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- The EC2 image module no longer fetches instance metadata in stage-1. This results in a significantly smaller initramfs, since network drivers no longer need to be included, and faster boots, since metadata fetching can happen in parallel with startup of other services.
This breaks services which rely on metadata being present by the time stage-2 is entered. Anything which reads EC2 metadata from `/etc/ec2-metadata` should now have an `after` dependency on `fetch-ec2-metadata.service`

- `minio` removed support for its legacy filesystem backend in [RELEASE.2022-10-29T06-21-33Z](https://github.com/minio/minio/releases/tag/RELEASE.2022-10-29T06-21-33Z). This means if your storage was created with the old format, minio will no longer start. Unfortunately minio doesn't provide a an automatic migration, they only provide [instructions how to manually convert the node](https://min.io/docs/minio/windows/operations/install-deploy-manage/migrate-fs-gateway.html). To facilitate this migration we keep around the last version that still supports the old filesystem backend as `minio_legacy_fs`. Use it via `services.minio.package = minio_legacy_fs;` to export your data before switching to the new version. See the corresponding [issue](https://github.com/NixOS/nixpkgs/issues/199318) for more details.

- `services.sourcehut.dispatch` and the corresponding package (`sourcehut.dispatchsrht`) have been removed due to [upstream deprecation](https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/).

- The [services.snapserver.openFirewall](#opt-services.snapserver.openFirewall) module option default value has been changed from `true` to `false`. You will need to explicitly set this option to `true`, or configure your firewall.
Expand Down
51 changes: 51 additions & 0 deletions pkgs/servers/minio/legacy_fs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:

let
# The web client verifies, that the server version is a valid datetime string:
# https://github.com/minio/minio/blob/3a0e7347cad25c60b2e51ff3194588b34d9e424c/browser/app/js/web.js#L51-L53
#
# Example:
# versionToTimestamp "2021-04-22T15-44-28Z"
# => "2021-04-22T15:44:28Z"
versionToTimestamp = version:
let
splitTS = builtins.elemAt (builtins.split "(.*)(T.*)" version) 1;
in
builtins.concatStringsSep "" [ (builtins.elemAt splitTS 0) (builtins.replaceStrings [ "-" ] [ ":" ] (builtins.elemAt splitTS 1)) ];
in
buildGoModule rec {
pname = "minio";
version = "2022-10-24T18-35-07Z";

src = fetchFromGitHub {
owner = "minio";
repo = "minio";
rev = "RELEASE.${version}";
sha256 = "sha256-sABNzhyfBNU5pWyE/VWHUzuSyKsx0glj01ectJPakV8=";
};

vendorSha256 = "sha256-wB3UiuptT6D0CIUlHC1d5k0rjIxNeh5yAWOmYpyLGmA=";

doCheck = false;

subPackages = [ "." ];

CGO_ENABLED = 0;

tags = [ "kqueue" ];

ldflags = let t = "github.com/minio/minio/cmd"; in [
"-s" "-w" "-X ${t}.Version=${versionToTimestamp version}" "-X ${t}.ReleaseTag=RELEASE.${version}" "-X ${t}.CommitID=${src.rev}"
];

passthru.tests.minio = nixosTests.minio;

meta = with lib; {
homepage = "https://www.minio.io/";
description = "An S3-compatible object storage server";
changelog = "https://github.com/minio/minio/releases/tag/RELEASE.${version}";
maintainers = with maintainers; [ eelco bachp ];
platforms = platforms.unix;
license = licenses.agpl3Plus;
};
}
3 changes: 3 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24129,6 +24129,9 @@ with pkgs;
micronaut = callPackage ../development/tools/micronaut {};

minio = callPackage ../servers/minio { };
# Keep around to allow people to migrate their data from the old legacy fs format
# https://github.com/minio/minio/releases/tag/RELEASE.2022-10-29T06-21-33Z
minio_legacy_fs = callPackage ../servers/minio/legacy_fs.nix { };

mkchromecast = libsForQt5.callPackage ../applications/networking/mkchromecast { };

Expand Down

0 comments on commit 8127165

Please sign in to comment.