Skip to content

Conversation

@nevehallon
Copy link

@nevehallon nevehallon commented May 27, 2021

In relation to https://github.com/leonstafford/lokl/issues/34
Performing check in the case that there is a timeout.

@leonstafford
Copy link
Contributor

Awesome, thanks for sending this @nevehallon. I'll check this and the reported issue out soon

@leonstafford
Copy link
Contributor

@nevehallon - the check in /var/lib/dpkg/arch looks a bit too OS-specific.

Would a uname call give us enough info about the arch?

@leonstafford
Copy link
Contributor

To elaborate, sorry. That path doesn't seem to exist outside of Debian-based distros or others which have specifically installed dpkg

@leonstafford
Copy link
Contributor

@nevehallon what architecture was your Lubuntu running on? Arm64?

@nevehallon
Copy link
Author

@nevehallon what architecture was your Lubuntu running on? Arm64?

It's running on amd64

@nevehallon
Copy link
Author

@nevehallon - the check in /var/lib/dpkg/arch looks a bit too OS-specific.

Would a uname call give us enough info about the arch?

uname doesn't provide achitecture information. At least not on my OS...

@leonstafford
Copy link
Contributor

Try 'uname -a', that usually ends with arch on *buntus

@nevehallon
Copy link
Author

I see.
I guess then it's best to sift through all the possible values for uname -m in order to determine if there is support for arm64.

@nevehallon
Copy link
Author

nevehallon commented May 27, 2021

Or, perhaps a more concise check would be running arch.
I get x86_64 on my machine and arch64 in the container via SSH.
@leonstafford Is that a better check? More OS-friendly?

@leonstafford
Copy link
Contributor

That looks perfect!

Just tested on my M1 mac and a remote OpenBSD machine:

leon@Leons-MacBook-Pro ~ % docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS  PLATFORMS
default * docker                  
  default default         running linux/arm64, linux/amd64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
leon@Leons-MacBook-Pro ~ % arch
arm64
leon@Leons-MacBook-Pro ~ % ssh someopenbsd
someopenbsd$ arch
OpenBSD.amd64

That docker buildx ls command from https://docs.docker.com/desktop/multi-arch/#build-and-run-multi-architecture-images I first thought was stating run capabilities for the host, but looks more like something I should be making sure I'm building with for more compatible images...

Will need to finish my current task before can properly look into this, but if you want to adjust the PR, I can test the scripts against a variety of architecture VPS's later to try and reproduce the issue.

(There is an argument to just show the arch with OpenBSD's arch command, might be similar on other BSDs, too. Noting, that OpenBSD has no ability to run Docker/Lokl yet, but I believe it might work fine on FreeBSD).

@nevehallon
Copy link
Author

Wasn't sure if I should include docker buildx ls as a check. (can remove if not needed)
I went with the uname -m - apparently arch is not installed by default acording to this doc:
https://www.gnu.org/software/coreutils/manual/html_node/arch-invocation.html#arch-invocation

-"arch is not installed by default, so portable scripts should not rely on its existence."

@leonstafford Let me know if this adjustment works.

@leonstafford
Copy link
Contributor

Many thanks @nevehallon!

It will take me a bit of time to get to test this on a few systems, but looks great!

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.

2 participants