Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update flake lock #117

Merged
merged 11 commits into from Mar 6, 2024
Merged

Conversation

conscious-puppet
Copy link
Contributor

No description provided.

in pgadmin-8.2, the command to setup configuration db is `setup-db`
@conscious-puppet conscious-puppet marked this pull request as draft March 2, 2024 15:18
test/flake.nix Outdated Show resolved Hide resolved
@conscious-puppet conscious-puppet marked this pull request as ready for review March 4, 2024 18:58
@@ -118,7 +118,7 @@ in
${config.package}/bin/.pgadmin4-setup-wrapped setup
else
# pgadmin-8.2 has .pgadmin4-cli-wrapped
${config.package}/bin/.pgadmin4-cli-wrapped setup
${config.package}/bin/.pgadmin4-cli-wrapped setup-db
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the context for this change? Is services-flake not supported on nixpkgs older to this update anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the PR #115, i made a mistake with the setup command for pgadmin 8.2. since the older nixpkgs had pgadmin 7.5, i could not test this and it got missed.

for older nixpkgs, pgadmin has pgadmin4-setup executable to setup the configuration db, and for newer nixpkgs, it has pgadmin4-cli executable to setup the db. so services-flake would support both

  if [ -f ${config.package}/bin/.pgadmin4-setup-wrapped ]; then
    # pgadmin-7.5 has .pgadmin4-setup-wrapped
    ${config.package}/bin/.pgadmin4-setup-wrapped setup
  else
    # pgadmin-8.2 has .pgadmin4-cli-wrapped
    ${config.package}/bin/.pgadmin4-cli-wrapped setup-db
  fi

@shivaraj-bh
Copy link
Member

shivaraj-bh commented Mar 5, 2024

Let’s understand if we really need this: #117 (comment)

Since NixOS/nixpkgs#283330, along with the go backend, grafana frontend is also built from source in nixpkgs. But the offline cache doesn’t support darwin, this can be fixed by overriding it:

{
  grafana = prev.grafana.overrideAttrs (oa: rec {
    offlineCache = oa.offlineCache.overrideAttrs (_ :{
      buildPhase = ''
        runHook preBuild
        export HOME="$(mktemp -d)"
        yarn config set enableTelemetry 0
        yarn config set cacheFolder $out
        yarn config set --json supportedArchitectures.os '[ “linux” “darwin" ]'
        yarn config set --json supportedArchitectures.cpu '[ “x64” “arm64" ]'
        yarn
        runHook postBuild
      '';
      outputHash = lib.fakeHash;
    });
  });
}

Note: replace the outputHash with whatever the offlinecache generates.

@shivaraj-bh
Copy link
Member

shivaraj-bh commented Mar 5, 2024

Even after fixing the frontend cache, the go backend fails to build. There is an upstream issue open: NixOS/nixpkgs#273998

Looks like it is do with nix: NixOS/nix#9977

@shivaraj-bh
Copy link
Member

As a workaround, we can use grafana < 10.2.0 until the case-insensitivity issue is resolved.

@shivaraj-bh
Copy link
Member

Turns out we can get the latest grafana build on darwin, thanks to: NixOS/nixpkgs#129730

@shivaraj-bh
Copy link
Member

CI fails with: no space left on device 🙂

@shivaraj-bh
Copy link
Member

Until we self-host the runner, hope this helps: actions/runner-images#2875

@shivaraj-bh shivaraj-bh merged commit e0a1074 into juspay:main Mar 6, 2024
4 checks passed
@srid
Copy link
Collaborator

srid commented Mar 7, 2024

@conscious-puppet @shivaraj-bh What's the original reason for updating flake.lock in this PR? If we revert this, can we avoid having to build grafana on CI and locally?

@conscious-puppet
Copy link
Contributor Author

some of the packages were old.

  • the default package for cassandra was cassandra 3. which had a dependency on python 2, and was no longer supported on aarch64-darwin
  • pgadmin4 also had an outdated version with different cli for setup db.

if we revert this, then we may not be able to test services flake against current package versions with just run <service> or just test <service>.

@conscious-puppet
Copy link
Contributor Author

if build is an issue, can we overlay grafana to an older version for darwin?

@srid
Copy link
Collaborator

srid commented Mar 7, 2024

can we overlay grafana to an older version for darwin?

This is what I'm trying now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants