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

ARM64 builds #2

Closed
fdcastel opened this issue Jun 15, 2024 · 14 comments · Fixed by #18
Closed

ARM64 builds #2

fdcastel opened this issue Jun 15, 2024 · 14 comments · Fixed by #18
Assignees

Comments

@fdcastel
Copy link
Member

No description provided.

@holgerflick
Copy link

Is there any update of this? Right now, only amd64 seems to be available.

@fdcastel
Copy link
Member Author

Not at this time. This remains an open issue currently.

@razvanphp
Copy link

razvanphp commented Jan 22, 2025

Can we contribute this to the Github Actions? Or what CI do you use for builds?

Thanks for taking the time to create this repo!

@fdcastel
Copy link
Member Author

Hey @razvanphp, thanks a ton for your enthusiasm to help out! 🎉

We’re currently in the middle of migrating this repo to the official Firebird repository and giving its build process a shiny new home with GitHub Actions. Stay tuned!

In the meantime, feel free to dive into this issue if you’re up for it and have experience with GitHub Actions and ARM64 builds. We’ll happily merge your work when it’s ready!

@asfernandes asfernandes self-assigned this Jan 26, 2025
@asfernandes
Copy link
Member

I think we should add for available arm64 Firebird versions their url and hashes to assets.json.

I need help with the powershell to identify what images should build the arm64 version in src/image.build.ps1.template.

The idea is to call docker two times there, like this, but only for the cases that should build arm64:

    $allParameters = @(
        'build';
        '--platform', 'linux/amd64';
        $tags;
        $noCacheParameter,
        '--label', 'org.opencontainers.image.description=Firebird Database',
        '--label', 'org.opencontainers.image.source=https://github.com/FirebirdSQL/firebird-docker',
        '--label', 'org.opencontainers.image.version=<%$TImageVersion%>',
        '.'
    )
    Write-Verbose "docker $allParameters"
    exec { & docker $allParameters }

    $allParameters = @(
        'build';
        '--platform', 'linux/arm64';
        '--build-arg', 'ARCH_ARM64=1';
        $tags;
        $noCacheParameter,
        '--label', 'org.opencontainers.image.description=Firebird Database',
        '--label', 'org.opencontainers.image.source=https://github.com/FirebirdSQL/firebird-docker',
        '--label', 'org.opencontainers.image.version=<%$TImageVersion%>',
        '.'
    )
    Write-Verbose "docker $allParameters"
    exec { & docker $allParameters }

@asfernandes
Copy link
Member

Multi-arch build (using same tags) is complicated in a way I didn't knew, but I have progressed a lot with this today.

@fdcastel
Copy link
Member Author

I think we should add for available arm64 Firebird versions their url and hashes to assets.json.

I need help with the powershell to identify what images should build the arm64 version in src/image.build.ps1.template.

Working on it.

@fdcastel
Copy link
Member Author

Just a heads-up: The arm64 branch already has a prototype of what you mentioned.

But it was my first attempt at it. And back then, the assets.json file had a completely different structure.

I'm working on a new version to rebuild assets.json containing the ARM64 platform releases.

@fdcastel
Copy link
Member Author

fdcastel commented Jan 27, 2025

@asfernandes I just pushed some initial work in #17.

I’m not sure this is the best structure for multi-arch builds, but I wanted to get it out there for your feedback and thoughts.

The current structure

  {
    "version": "5.0.1",
    "platform": "amd64",
    "url": "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.1/Firebird-5.0.1.1469-0-linux-x64.tar.gz",
    "sha256": "e1023b005e5d6db8f717af032e91f0f94aa7a8dbe0e78f250931214ca0a21e57",
    "tags": {
      "bookworm": [
        "5",
        "5.0.1",
        "latest"
      ],
      "bullseye": [
        "bullseye",
        "5-bullseye",
        "5.0.1-bullseye"
      ],
      "jammy": [
        "jammy",
        "5-jammy",
        "5.0.1-jammy"
      ],
      "noble": [
        "noble",
        "5-noble",
        "5.0.1-noble"
      ]
    }
  },
  {
    "version": "5.0.1",
    "platform": "arm64",
    "url": "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.1/Firebird-5.0.1.1469-0-linux-arm64.tar.gz",
    "sha256": "46b3f4f170458a93365c67118c062ba8509903fe8293bf8a62e7bd8a388e2d06",
    "tags": {
      "bookworm": [
        "5.0.1"
      ],
      "bullseye": [
        "5.0.1-bullseye"
      ],
      "jammy": [
        "5.0.1-jammy"
      ],
      "noble": [
        "5.0.1-noble"
      ]
    }
  }

will probably cause conflicts with multi-arch. Ex. the latest tag only applies to the amd64 platform. And for a correct multi-arch image the platform must be "tag-independent".

I'm inclined to group platforms inside each release. E.g.:

  {
    "version": "5.0.1",
    "platforms": {
      "amd64": {
        "url": "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.1/Firebird-5.0.1.1469-0-linux-x64.tar.gz",
        "sha256": "e1023b005e5d6db8f717af032e91f0f94aa7a8dbe0e78f250931214ca0a21e57"
      },
      "arm64": {
        "url": "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.1/Firebird-5.0.1.1469-0-linux-arm64.tar.gz",
        "sha256": "46b3f4f170458a93365c67118c062ba8509903fe8293bf8a62e7bd8a388e2d06"
      }
    },
    "tags": {
      "bookworm": [
        "5",
        "5.0.1",
        "latest"
      ],
      "bullseye": [
        "bullseye",
        "5-bullseye",
        "5.0.1-bullseye"
      ],
      "jammy": [
        "jammy",
        "5-jammy",
        "5.0.1-jammy"
      ],
      "noble": [
        "noble",
        "5-noble",
        "5.0.1-noble"
      ]
    }
  }

What do you think?

@asfernandes
Copy link
Member

I hadn't seen the amd64 branch, so I did some similar work.

About multiarch, buildx --push is weird as it would break the tests, so I did it with manifest and extra repositories.

About assets.json, I'd go for single version entry with multiple urls per platform. That was the place I'd still had a bug.

I will open draft PR with my changes so you can see them.

@asfernandes
Copy link
Member

Here is the PR: #18

asfernandes added a commit that referenced this issue Feb 1, 2025
ARM64 support for Firebird v5 (noble and bookworm)
@asfernandes asfernandes linked a pull request Feb 1, 2025 that will close this issue
@mrotteveel
Copy link
Member

@asfernandes Given this ticket is closed, does it mean ARM64 images should now be available? Because https://hub.docker.com/r/firebirdsql/firebird/tags still lists only linux/amd64.

@asfernandes
Copy link
Member

@asfernandes Given this ticket is closed, does it mean ARM64 images should now be available? Because https://hub.docker.com/r/firebirdsql/firebird/tags still lists only linux/amd64.

Looks like we have some problem in the pipeline.

If you look now in https://hub.docker.com/layers/firebirdsql/firebird/5.0.1-noble/images/sha256-330915a12a41fab159037dd7ef53c8e2c29e6df7ea342f05901f863c0a352b7d you will see it's a multiarch amd64/arm64 image.

This image I now published running from my machine.

I have tried again after my push in the pipeline but the job is stuck (https://github.com/FirebirdSQL/firebird-docker/actions/runs/13120151826 - first one run for 6 hour, second was running for more time than others and I cancelled).

Need to better understand, maybe decreasing parallel executions of tests @fdcastel ?

@asfernandes
Copy link
Member

A new run of the workflow made all images with arm64 support appears correctly: https://hub.docker.com/r/firebirdsql/firebird/tags

Let's continue monitoring.

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 a pull request may close this issue.

5 participants