Skip to content

armv7l builds for --link #4143

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

Closed
immjs opened this issue Sep 11, 2021 · 19 comments
Closed

armv7l builds for --link #4143

immjs opened this issue Sep 11, 2021 · 19 comments

Comments

@immjs
Copy link

immjs commented Sep 11, 2021

OS/Web Information

  • Web Browser:(irrelevant)
  • Local OS:(irrelevant)
  • Remote OS:Raspbian (Debian 10)
  • Remote Architecture:armv7l
  • code-server --version:3.11.1

Steps to Reproduce

1.install code-server
2.run code-server --link

Expected

Give me a link which links my machine to cdr.co's servers.

Actual

404 when trying to download the file that makes it happen

Logs

[2021-09-11T20:49:35.234Z] info  code-server 3.11.1 acb5de66b71a3f8f1cc065df4633ecd3f9788d46
[2021-09-11T20:49:35.246Z] info  Using user-data-dir ~/.local/share/code-server
[2021-09-11T20:49:35.357Z] info  Using config file ~/.config/code-server/config.yaml
[2021-09-11T20:49:35.358Z] info  HTTP server listening on http://127.0.0.1:40505 (randomized by --link)
[2021-09-11T20:49:35.359Z] info    - Authentication is disabled (disabled by --link)
[2021-09-11T20:49:35.360Z] info    - Not serving HTTPS (disabled by --link)
[2021-09-11T20:49:35.363Z] debug running agent with bind,--code-server-addr=127.0.0.1:40505,
[2021-09-11T20:49:35.411Z] error spawn /home/pi/.nvm/versions/node/v14.17.6/lib/node_modules/code-server/lib/coder-cloud-agent ENOENT
[2021-09-11T20:49:35.417Z] debug child:4758 disposing {}

Screenshot

Notes

It would look like a deliberate move but i don't see the purpose.

This issue can be reproduced in VS Code: Yes/No

@jsjoeio jsjoeio changed the title --link not maintained anymore? --link returns 404 Sep 13, 2021
@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Sep 13, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 13, 2021

I just tested locally and cannot reproduce.

image

image

--link is actually in the middle of a big refactor though and we're going to be beta testing some new features. If you're interested, let us know!

cc @kylecarbs

@immjs
Copy link
Author

immjs commented Sep 14, 2021 via email

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 14, 2021

@bpmct might be able to help you!

@bpmct
Copy link
Member

bpmct commented Sep 15, 2021

The problem is the current --link agent is not built for the Raspberry Pi.

We are working on a new version of Link and will make sure we make armv7l builds. We aim on sharing this by Friday and will be sure to let you know :)

In the meantime, you could try and build the binary yourself and move it to/home/pi/.nvm/versions/node/v14.17.6/lib/node_modules/code-server/lib/coder-cloud-agent

@bpmct bpmct changed the title --link returns 404 armv7l builds for --link Sep 15, 2021
@immjs
Copy link
Author

immjs commented Sep 15, 2021 via email

@immjs
Copy link
Author

immjs commented Sep 15, 2021

Although now, go build builds without a version number. Now I get

[2021-09-15T06:16:24.384Z] info  Failed to login: unable to login: Agent version () is incompatible. Version v0.2.1 or later is required. Try updating to the latest release at https://github.com/cdr/code-server/releases

@bpmct
Copy link
Member

bpmct commented Sep 15, 2021

Ah! I can't remember if you have to specify v0.2.1 or 0.2.1, but you'll need to build with this flag:

go build -ldflags "-X go.coder.com/cloud-agent/internal/version.Version=v0.2.1"
# or
go build -ldflags "-X go.coder.com/cloud-agent/internal/version.Version=0.2.1"

This is how it is built for releases: https://github.com/cdr/cloud-agent/blob/master/.github/workflows/release.yaml#L28

@immjs
Copy link
Author

immjs commented Sep 16, 2021

This works alright now, thank you! Im facing a new ossue now, should I open a new one? It just gives me the latency but doesnt give me a link

@immjs
Copy link
Author

immjs commented Sep 16, 2021

Ah! I can't remember if you have to specify v0.2.1 or 0.2.1, but you'll need to build with this flag:

go build -ldflags "-X go.coder.com/cloud-agent/internal/version.Version=v0.2.1"
# or
go build -ldflags "-X go.coder.com/cloud-agent/internal/version.Version=0.2.1"

This is how it is built for releases: https://github.com/cdr/cloud-agent/blob/master/.github/workflows/release.yaml#L28

@bpmct It's with the v btw

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 16, 2021

Im facing a new ossue now, should I open a new one? It just gives me the latency but doesnt give me a link

cc @bpmct @kylecarbs any ideas?

@immjs
Copy link
Author

immjs commented Sep 16, 2021

Oh, update, it didnt give it enough of a chance: It tried to read a json but failed coz the header was EOF

@bpmct
Copy link
Member

bpmct commented Sep 17, 2021

Ah cool. We will have a new release soon which will resolve these networking issues

@1tszyau
Copy link

1tszyau commented Sep 28, 2021

I am running into the same issue by installing using the script (which install code-server using brew). The code-server version that brew installed is 3.12.0. I am currently using a Mac.

@bpmct
Copy link
Member

bpmct commented Sep 28, 2021

I think this is likely because postinstall script is not running, which will be fixed for the next release. (#4231) Could you try manually running these lines in your terminal?

Where brew installed code-server

https://github.com/cdr/code-server/blob/main/ci/build/npm-postinstall.sh#L59-L64%5C

@1tszyau
Copy link

1tszyau commented Sep 28, 2021

Thank you so much for replying me.
I have to apologise as I am very new to shell code, and don't really understand how all these magic works (and not works).

I tried to install after uninstalling code-server using "brew install code-server"
After that, I just copy and paste what you have highlighted in the postinstall script.

Here is the response:

curl: (22) The requested URL returned error: 404 
Failed to download cloud agent; --link will not work

Hope this information is helpful.

image

@bpmct
Copy link
Member

bpmct commented Sep 28, 2021

@1tszyau You did that right. What is the output of uname | tr '[:upper:]' '[:lower:]'

Ah, whoops. Try running this

# Copied from arch() in ci/lib.sh.
detect_arch() {
  case "$(uname -m)" in
    aarch64)
      echo arm64
      ;;
    x86_64 | amd64)
      echo amd64
      ;;
    *)
      # This will cause the download to fail, but is intentional
      uname -m
      ;;
  esac
}

ARCH="${NPM_CONFIG_ARCH:-$(detect_arch)}"

  OS="$(uname | tr '[:upper:]' '[:lower:]')"
  if curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent; then
    chmod +x ./lib/coder-cloud-agent
  else
    echo "Failed to download cloud agent; --link will not work"
  fi

you can also put it in a .sh script (e.g "install-link.sh")

@1tszyau
Copy link

1tszyau commented Sep 28, 2021

I paste your code into a install-link.sh, and use:

chmod +x install-link.sh
sudo ./install-link.sh

Here is the response:

curl: (23) Failed writing body (0 != 1406)
Failed to download cloud agent; --link will not work

image

Edited: The output is "darwin" for your first question.
image

Thanks!

@bpmct
Copy link
Member

bpmct commented Sep 30, 2021

@1tszyau I would recommend using another method to connect to Coder for now, as we still have a lot to do with the new version: https://coder.com/docs/code-server/v3.12.0/guide#using-lets-encrypt-with-caddy

@stale
Copy link

stale bot commented Mar 29, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Mar 29, 2022
@stale stale bot closed this as completed Apr 3, 2022
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
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

No branches or pull requests

5 participants