Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: arm(v7/64) builds for releases and agent scripts#1337

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bpmct merged 8 commits intomainfrombpmct/armv7
May 11, 2022
Merged

Conversation

bpmct
Copy link
Member

@bpmctbpmct commentedMay 9, 2022
edited
Loading

This PR adds builds armv7 Linux releases. Most notably, this will improve support for Raspberry Pi operating systems

Fixes#1336

benpotter@elijo:~ $ cat /proc/cpuinfoprocessor: 0model name: ARMv7 Processor rev 3 (v7l)BogoMIPS: 108.00Features: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU implementer: 0x41CPU architecture: 7CPU variant: 0x0CPU part: 0xd08CPU revision: 3... processors 1, 2, 3Hardware: BCM2711Revision: c03111Serial: 10000000e67636d1Model: Raspberry Pi 4 Model B Rev 1.1benpotter@elijo:~ $ coder --versionCoder v0.5.4-devel+ad8d9dd Fri May  6 20:45:18 UTC 2022https://github.com/coder/coder/commit/ad8d9dd71a3e3672e78d48058f29bbe5b251bdfbbenpotter@elijo:~ $

im-coder-lg and kylecarbs reacted with thumbs up emojiim-coder-lg and kylecarbs reacted with laugh emojiim-coder-lg and kylecarbs reacted with hooray emojiim-coder-lg and kylecarbs reacted with eyes emoji
@bpmctbpmct requested a review fromkylecarbsMay 9, 2022 02:56
@bpmctbpmct changed the titlefeat: build armv7 linux releases (raspberry pi support)feat: build armv7 linux releases (raspberry pi 4 support)May 9, 2022
@bpmctbpmct self-assigned thisMay 9, 2022
@bpmctbpmct added the ci 🤖 labelMay 9, 2022
@codecov
Copy link

codecovbot commentedMay 9, 2022
edited
Loading

Codecov Report

Merging#1337 (01d5b50) intomain (ad8d9dd) willincrease coverage by0.56%.
The diff coverage is100.00%.

@@            Coverage Diff             @@##             main    #1337      +/-   ##==========================================+ Coverage   66.44%   67.01%   +0.56%==========================================  Files         284      288       +4       Lines       18584    18857     +273       Branches      235      241       +6     ==========================================+ Hits        12349    12637     +288+ Misses       4967     4932      -35- Partials     1268     1288      +20
FlagCoverage Δ
unittest-go-macos-latest54.09% <100.00%> (+0.38%)⬆️
unittest-go-postgres-65.47% <100.00%> (+0.34%)⬆️
unittest-go-ubuntu-latest56.48% <100.00%> (+0.46%)⬆️
unittest-go-windows-202252.39% <0.00%> (+0.33%)⬆️
unittest-js74.24% <ø> (+0.56%)⬆️
Impacted FilesCoverage Δ
provisionersdk/agent.go100.00% <100.00%> (ø)
site/src/components/TableHeaders/TableHeaders.tsx91.66% <0.00%> (-8.34%)⬇️
codersdk/roles.go72.72% <0.00%> (-7.92%)⬇️
site/src/components/Table/Table.tsx96.00% <0.00%> (-4.00%)⬇️
site/src/components/UsersTable/UsersTable.tsx96.00% <0.00%> (-4.00%)⬇️
site/src/xServices/users/usersXService.ts72.91% <0.00%> (-2.09%)⬇️
codersdk/users.go63.79% <0.00%> (-1.39%)⬇️
site/src/api/index.ts70.00% <0.00%> (-1.24%)⬇️
provisionerd/provisionerd.go76.84% <0.00%> (-0.27%)⬇️
coderd/database/queries.sql.go77.90% <0.00%> (-0.25%)⬇️
... and57 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatead8d9dd...01d5b50. Read thecomment docs.

@bpmct
Copy link
MemberAuthor

bpmct commentedMay 9, 2022
edited
Loading

@kylecarbs I think the Terraform provider has to be updated supportarm_7 as an arch as well? Is it as simple as changing the validation rule?

https://github.com/coder/terraform-provider-coder/blob/4531753ebf98fbbd912eec8503c45dde6313a459/internal/provider/provider.go#L162-L167

Oh, and the agent scripts:

"linux": {
"amd64":`#!/usr/bin/env sh
set -eu pipefail
export BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXX)/coder
curl -fsSL ${ACCESS_URL}bin/coder-linux-amd64 -o $BINARY_LOCATION
chmod +x $BINARY_LOCATION
export CODER_AGENT_AUTH="${AUTH_TYPE}"
export CODER_AGENT_URL="${ACCESS_URL}"
exec $BINARY_LOCATION agent`,
},

I also noticed that the binary isn't being uploaded to[coder-url]/bin/coder-arm_7. In fact, none of the arm builds are. Any ideas?

Screen Shot 2022-05-08 at 10 21 08 PM

Edit: I think it has to do with the coder slim build only building amd64 binaries. I'll test in the morning

-id:coder-slim
dir:cmd/coder
ldflags:
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
env:[CGO_ENABLED=0]
goos:[darwin, linux, windows]
goarch:[amd64]
hooks:
# The "trimprefix" appends ".exe" on Windows.
post:|
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ trimprefix .Name "coder" }}

@kylecarbs
Copy link
Member

kylecarbs commentedMay 9, 2022
edited
Loading

@bpmct
Copy link
MemberAuthor

still need to a bit of work to expose the agent start script

@bpmctbpmct requested a review fromkylecarbsMay 10, 2022 22:38
@bpmctbpmct marked this pull request as draftMay 10, 2022 22:39
@bpmct
Copy link
MemberAuthor

bpmct commentedMay 10, 2022
edited
Loading

Testing with my raspberry pi now :)

Edit: Running into an issue parsing templates

Edit 2: got this working!

kylecarbs reacted with rocket emoji

@bpmctbpmct marked this pull request as ready for reviewMay 11, 2022 01:06
@im-coder-lg
Copy link
Contributor

So, just a few doubts - but I will test this.

  1. Does this have compatible Docker images?
  2. Will this work on arm64 now that we got scripts in the build?
  3. -Most Important- how much time does it take to build Coder freshly?

@bpmct
Copy link
MemberAuthor

So, just a few doubts - but I will test this.

  1. Does this have compatible Docker images?
  2. Will this work on arm64 now that we got scripts in the build?
  3. -Most Important- how much time does it take to build Coder freshly?

All great questions.

  1. You need to specify armv7 compatible images in the template. I'll write a guide on how to do this. Sadlyarmv7:ubuntu won't work because it doesn't containcurl
  2. Yes
  3. Not long (~3 minutes), but these changes mean a build is provided (.deb, .apk, or binary) for each release

@im-coder-lg
Copy link
Contributor

Thanks for the answers, I will start my build now.

@im-coder-lg
Copy link
Contributor

You need to specify armv7 compatible images in the template. I'll write a guide on how to do this.

I know how to modify the main.tf if that's what you mean. What I will have to do(i hope it's right) is go to Docker Hub and find an ARM64(my pi is 64-bit ARM) image. Then, I should add that image name to its respective section in the main.tf file. Then I should create a workspace. Am I right on this?
P.S. my pi is arm64, so (don't wanna sound rude, it happens with me) I think it could be better if you refer to this as arm. Just arm if it's fine with you.

@bpmct
Copy link
MemberAuthor

I know how to modify the main.tf if that's what you mean. What I will have to do(i hope it's right) is go to Docker Hub and find an ARM64(my pi is 64-bit ARM) image. Then, I should add that image name to its respective section in the main.tf file. > Then I should create a workspace. Am I right on this?

Correct. That image needs to havecurl in it. You also need to change the coder_agentarch to use arm64.

P.S. my pi is arm64, so (don't wanna sound rude, it happens with me) I think it could be better if you refer to this as arm. > Just arm if it's fine with you.

Yeah, I initially submitted this to add support for armv7 but it grew in scope when I realized the arm64 scripts weren't being added

@bpmctbpmct changed the titlefeat: build armv7 linux releases (raspberry pi 4 support)feat: arm(v7/64) builds for releases and agent scriptsMay 11, 2022
hooks:
# The "trimprefix" appends ".exe" on Windows.
post: |
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ trimprefix .Name "coder" }}
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{if .Arm }}v{{ .Arm }}{{ end }}{{trimprefix .Name "coder" }}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

kylecarbs reacted with thumbs up emoji
@im-coder-lg
Copy link
Contributor

Umm.... We got a situation here. I am encountering this:
run parse: recv parse source: manager closed: EOF

Any solutions? My Pi's Neofetch if it helps:

     _,met$$$$$gg.          pi@geniuspi     ,g$$$$$$$$$$$$$$$P.       -----------   ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 11 (bullseye) aarch64  ,$$P'              `$$$.     Host: Raspberry Pi 4 Model B Rev 1.4 ',$$P       ,ggs.     `$$b:   Kernel: 5.15.32-v8+ `d$$'     ,$P"'   .    $$$    Uptime: 15 mins  $$P      d$'     ,    $$P    Packages: 2074 (dpkg)  $$:      $$.   -    ,d$$'    Shell: bash 5.1.4  $$;      Y$b._   _,d$P'      Resolution: 1920x1080  Y$$.    `.`"Y$$$$P"'         DE: Plasma 5.20.5  `$$b      "-.__              WM: KWin   `Y$$                        WM Theme: ChromeOS-light    `Y$$.                      Theme: Breeze [Plasma], Breeze [GTK2/3]      `$$b.                    Icons: Tela-circle [Plasma], Tela-circle [GTK2/3]        `Y$$b.                 Terminal: konsole           `"Y$b._             CPU: BCM2835 (4) @ 1.800GHz               `"""            Memory: 762MiB / 7812MiB

@bpmct
Copy link
MemberAuthor

Umm.... We got a situation here. I am encountering this:
run parse: recv parse source: manager closed: EOF

Any solutions? My Pi's Neofetch if it helps:

Apologies! This is a known issue and a bug in the upstream Terraform library. Installing Terraform on your Pi will fix this as a workaround.

@im-coder-lg
Copy link
Contributor

im-coder-lg commentedMay 11, 2022 via email

10-4! I am going outside now, but I will try when I'm back! Thanks for that clue!

Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

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

Awesome!

@bpmctbpmct merged commitf581724 intomainMay 11, 2022
@bpmctbpmct deleted the bpmct/armv7 branchMay 11, 2022 14:44
@im-coder-lg
Copy link
Contributor

I know this is merged and all that, but@bpmct did it work properly for you? I inserted custom images that use Ubuntu ARM, two from Canonical's kinda proxies ARMv8 provider(that's arm64, if I am not wrong) and one from a person or org named osrf. All of them failed, so are there any working images that use ARM64?

@bpmct
Copy link
MemberAuthor

@im-coder-lg can we discuss this in your issue or in Discord?

@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
kylecarbs added a commit that referenced this pull requestJun 10, 2022
* feat: build armv7 linux releases* upload ARM binaries to bin* Only build arm 7 for Linux* add ARM agent scripts* fix: specify armv7 to match tf provider* append arm version to slim builds* use descript armv7 binary* Add script mappings for each architectureCo-authored-by: kylecarbs <kyle@carberry.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@bpmctbpmct

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

Feat: linux armv7 builds (raspberry pi)
4 participants
@bpmct@kylecarbs@im-coder-lg@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp