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

ARM docker image available? #587

Open
nunnsby opened this issue Mar 8, 2022 · 7 comments
Open

ARM docker image available? #587

nunnsby opened this issue Mar 8, 2022 · 7 comments

Comments

@nunnsby
Copy link

nunnsby commented Mar 8, 2022

Description
ARM Based host running container start-up fails with the following error:

standard_init_linux.go:228: exec user process caused: exec format error

AWS EC2 Graviton host, running ubuntu.

lscpu from host:

Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: ARM
Model: 1
Model name: Neoverse-N1
Stepping: r3p1
BogoMIPS: 243.75
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 2 MiB
L3 cache: 32 MiB
NUMA node0 CPU(s): 0,1
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs

Version
latest docker image, but obviously AMD64, hence not working

I appreciate this is not an easy ask, but just wondering if it has been considered or is in the pipeline? Happy for you to close this if not being considered.
Any alternatives? I have not tried installing the binary directly, but "assume" it will have the same issue of being coded for an amd64 chipset, so am not sure if that will work.

@paololucente
Copy link
Member

Hi @nunnsby ,

Thank you very much for reaching. With Marc ( @msune ) we had a brief chat and he looks positive this is something that can be certainly done. Marc being the father of current pmacct CI / Docker efforts. I will keep this issue open and mark it as an enhancement / feature request. We'll have soon news for you.

Paolo

@msune
Copy link
Contributor

msune commented Mar 8, 2022

Any alternatives? I have not tried installing the binary directly, but "assume" it will have the same issue of being coded for an amd64 chipset, so am not sure if that will work.

You can surely try to build it from the sources, following: https://github.com/pmacct/pmacct#building

@msune
Copy link
Contributor

msune commented Mar 8, 2022

(premature send)

And you should also probably be able to build (local) docker images:

          docker build -f docker/base/Dockerfile -t base:_build .
          docker build -f docker/pmacctd/Dockerfile -t pmacctd:latest .
          docker build -f docker/nfacctd/Dockerfile -t nfacctd:latest .
          docker build -f docker/sfacctd/Dockerfile -t sfacctd:latest .
          docker build -f docker/uacctd/Dockerfile -t uacctd:latest .
          docker build -f docker/pmbgpd/Dockerfile -t pmbgpd:latest .
          docker build -f docker/pmbmpd/Dockerfile -t pmbmpd:latest .

(mind untested commands)

@nunnsby
Copy link
Author

nunnsby commented Dec 29, 2022

Hey there, still failing. Only got around to testing now as I had rebuilt the previous machine as an AMD at the time.

Errors below, from the end of the build of base:_build

###########################################################

Configure failed

###########################################################

Accumulated failures:

###########################################################
avro_c (ENABLE_AVRO_C)
module: self
action: fail
reason:
compile check failed:
CC: CC
flags: -lavro
gcc -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -Wall -Werror _mkltmpO4ugRY.c -o _mkltmpO4ugRY.c.o -lavro :
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_object@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_string_value@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_loadb@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_null@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_integer@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_array_size@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_loads@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_real@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_array_get@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_dumps@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_string_nocheck@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_object_get@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_string@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_array@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_array_append_new@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_true@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_delete@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_false@libjansson.so.4'
/usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_integer_value@libjansson.so.4' /usr/bin/ld: //usr/local/lib/libavro.so: undefined reference to json_object_set_new@libjansson.so.4'
collect2: error: ld returned 1 exit status
source: #include <avro.h>

The command '/bin/sh -c ./ci/deps.sh' returned a non-zero code: 1

SYSTEM INFO BELOW:

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
...
UBUNTU_CODENAME=jammy

$ lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Vendor ID: ARM
Model name: Neoverse-N1
Model: 1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
Stepping: r3p1
BogoMIPS: 243.75
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
Caches (sum of all):
L1d: 128 KiB (2 instances)
L1i: 128 KiB (2 instances)
L2: 2 MiB (2 instances)
L3: 32 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0,1
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Mitigation; CSV2, BHB
Srbds: Not affected
Tsx async abort: Not affected

@paololucente
Copy link
Member

Hi @nunnsby ,

It seems it's just missing libjansson, a requirement for libavro. Jansson is compiled before libavro in deps.sh. Maybe that one failed to compile / install and hence it is triggering this fail?

Paolo

@nunnsby
Copy link
Author

nunnsby commented Jan 10, 2023

Actually the avro part of the build kicks back a number of errors, not libjansson:

...

[ 19%] Building C object src/CMakeFiles/avro-static.dir/datum_value.c.o
/tmp/avro-c-1.11.1/src/datum_value.c: In function 'avro_datum_value_get_type':
/tmp/avro-c-1.11.1/src/datum_value.c:86:2: warning: #warning "Bug: EINVAL is not of type avro_type_t." [-Wcpp]
#warning "Bug: EINVAL is not of type avro_type_t."
^~~~~~~
/tmp/avro-c-1.11.1/src/datum_value.c: In function 'avro_datum_value_get_type':
/tmp/avro-c-1.11.1/src/datum_value.c:86:2: warning: #warning "Bug: EINVAL is not of type avro_type_t." [-Wcpp]
#warning "Bug: EINVAL is not of type avro_type_t."
^~~~~~~
[ 20%] Building C object src/CMakeFiles/avro-shared.dir/datum_write.c.o

...

[ 37%] Building C object src/CMakeFiles/avro-static.dir/schema.c.o
/tmp/avro-c-1.11.1/src/schema.c: In function 'avro_schema_from_json_t':
/tmp/avro-c-1.11.1/src/schema.c:882:3: warning: #warning "Bug: '0' is not of type avro_type_t." [-Wcpp]
#warning "Bug: '0' is not of type avro_type_t."
^~~~~~~
/tmp/avro-c-1.11.1/src/schema.c: In function 'avro_schema_from_json_t':
/tmp/avro-c-1.11.1/src/schema.c:882:3: warning: #warning "Bug: '0' is not of type avro_type_t." [-Wcpp]
#warning "Bug: '0' is not of type avro_type_t."
^~~~~~~
[ 38%] Building C object src/CMakeFiles/avro-shared.dir/schema_equal.c.o

...

[ 41%] Building C object src/CMakeFiles/avro-static.dir/st.c.o
/tmp/avro-c-1.11.1/src/st.c: In function 'st_foreach':
/tmp/avro-c-1.11.1/src/st.c:467:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (!tmp) {
^
/tmp/avro-c-1.11.1/src/st.c:476:4: note: here
case ST_CONTINUE:
^~~~
/tmp/avro-c-1.11.1/src/st.c: In function 'st_foreach':
/tmp/avro-c-1.11.1/src/st.c:467:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (!tmp) {
^
/tmp/avro-c-1.11.1/src/st.c:476:4: note: here
case ST_CONTINUE:
^~~~
[ 41%] Building C object src/CMakeFiles/avro-shared.dir/string.c.o

...

[ 45%] Building C object src/CMakeFiles/avro-static.dir/value-hash.c.o
/tmp/avro-c-1.11.1/src/value-hash.c: In function 'hash_buffer':
/tmp/avro-c-1.11.1/src/value-hash.c:109:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 3: k1 ^= tail[2] << 16;
~~~^~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/src/value-hash.c:110:3: note: here
case 2: k1 ^= tail[1] << 8;
^~~~
/tmp/avro-c-1.11.1/src/value-hash.c:110:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 2: k1 ^= tail[1] << 8;
~~~^~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/src/value-hash.c:111:3: note: here
case 1: k1 ^= tail[0];
^~~~
/tmp/avro-c-1.11.1/src/value-hash.c: In function 'hash_buffer':
/tmp/avro-c-1.11.1/src/value-hash.c:109:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 3: k1 ^= tail[2] << 16;
~~~^~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/src/value-hash.c:110:3: note: here
case 2: k1 ^= tail[1] << 8;
^~~~
/tmp/avro-c-1.11.1/src/value-hash.c:110:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 2: k1 ^= tail[1] << 8;
~~~^~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/src/value-hash.c:111:3: note: here
case 1: k1 ^= tail[0];
^~~~
[ 46%] Building C object src/CMakeFiles/avro-shared.dir/value-json.c.o

...

[ 61%] Building C object tests/CMakeFiles/test_avro_1906.dir/test_avro_1906.c.o
In file included from /tmp/avro-c-1.11.1/src/avro/legacy.h:33,
from /tmp/avro-c-1.11.1/src/avro/io.h:31,
from /tmp/avro-c-1.11.1/src/avro/consumer.h:30,
from /tmp/avro-c-1.11.1/src/avro.h:28,
from /tmp/avro-c-1.11.1/examples/quickstop.c:18:
/tmp/avro-c-1.11.1/examples/quickstop.c: In function 'print_person':
/tmp/avro-c-1.11.1/examples/quickstop.c:123:40: warning: passing argument 3 of 'first_value.iface->get_string' from incompatible pointer type [-Wincompatible-pointer-types]
avro_value_get_string(&first_value, &p, &size);
^~
/tmp/avro-c-1.11.1/src/avro/value.h:408:60: note: in definition of macro 'avro_value_call'
(value)->iface->method((value)->iface, (value)->self, VA_ARGS))
^~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:123:4: note: in expansion of macro 'avro_value_get_string'
avro_value_get_string(&first_value, &p, &size);
^~~~~~~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:123:40: note: expected 'const char **' but argument is of type 'int32_t **' {aka 'int **'}
avro_value_get_string(&first_value, &p, &size);
^~
/tmp/avro-c-1.11.1/src/avro/value.h:408:60: note: in definition of macro 'avro_value_call'
(value)->iface->method((value)->iface, (value)->self, VA_ARGS))
^~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:123:4: note: in expansion of macro 'avro_value_get_string'
avro_value_get_string(&first_value, &p, &size);
^~~~~~~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:124:24: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int32_t *' {aka 'int *'} [-Wformat=]
fprintf(stdout, "%15s | ", p);
~~~^ ~
%15ls
In file included from /tmp/avro-c-1.11.1/src/avro/legacy.h:33,
from /tmp/avro-c-1.11.1/src/avro/io.h:31,
from /tmp/avro-c-1.11.1/src/avro/consumer.h:30,
from /tmp/avro-c-1.11.1/src/avro.h:28,
from /tmp/avro-c-1.11.1/examples/quickstop.c:18:
/tmp/avro-c-1.11.1/examples/quickstop.c:127:39: warning: passing argument 3 of 'last_value.iface->get_string' from incompatible pointer type [-Wincompatible-pointer-types]
avro_value_get_string(&last_value, &p, &size);
^~
/tmp/avro-c-1.11.1/src/avro/value.h:408:60: note: in definition of macro 'avro_value_call'
(value)->iface->method((value)->iface, (value)->self, VA_ARGS))
^~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:127:4: note: in expansion of macro 'avro_value_get_string'
avro_value_get_string(&last_value, &p, &size);
^~~~~~~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:127:39: note: expected 'const char **' but argument is of type 'int32_t **' {aka 'int **'}
avro_value_get_string(&last_value, &p, &size);
^~
/tmp/avro-c-1.11.1/src/avro/value.h:408:60: note: in definition of macro 'avro_value_call'
(value)->iface->method((value)->iface, (value)->self, VA_ARGS))
^~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:127:4: note: in expansion of macro 'avro_value_get_string'
avro_value_get_string(&last_value, &p, &size);
^~~~~~~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:128:24: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int32_t *' {aka 'int *'} [-Wformat=]
fprintf(stdout, "%15s | ", p);
~~~^ ~
%15ls
In file included from /tmp/avro-c-1.11.1/src/avro/legacy.h:33,
from /tmp/avro-c-1.11.1/src/avro/io.h:31,
from /tmp/avro-c-1.11.1/src/avro/consumer.h:30,
from /tmp/avro-c-1.11.1/src/avro.h:28,
from /tmp/avro-c-1.11.1/examples/quickstop.c:18:
/tmp/avro-c-1.11.1/examples/quickstop.c:131:40: warning: passing argument 3 of 'phone_value.iface->get_string' from incompatible pointer type [-Wincompatible-pointer-types]
avro_value_get_string(&phone_value, &p, &size);
^~
/tmp/avro-c-1.11.1/src/avro/value.h:408:60: note: in definition of macro 'avro_value_call'
(value)->iface->method((value)->iface, (value)->self, VA_ARGS))
^~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:131:4: note: in expansion of macro 'avro_value_get_string'
avro_value_get_string(&phone_value, &p, &size);
^~~~~~~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:131:40: note: expected 'const char **' but argument is of type 'int32_t **' {aka 'int **'}
avro_value_get_string(&phone_value, &p, &size);
^~
/tmp/avro-c-1.11.1/src/avro/value.h:408:60: note: in definition of macro 'avro_value_call'
(value)->iface->method((value)->iface, (value)->self, VA_ARGS))
^~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:131:4: note: in expansion of macro 'avro_value_get_string'
avro_value_get_string(&phone_value, &p, &size);
^~~~~~~~~~~~~~~~~~~~~
/tmp/avro-c-1.11.1/examples/quickstop.c:132:24: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int32_t *' {aka 'int *'} [-Wformat=]
fprintf(stdout, "%15s | ", p);
~~~^ ~
%15ls
/tmp/avro-c-1.11.1/examples/quickstop.c:95:55: warning: unused parameter 'reader_schema' [-Wunused-parameter]
int print_person(avro_file_reader_t db, avro_schema_t reader_schema)
~~~~~~~~~~~~~~^~~~~~~~~~~~~
/tmp/avro-c-1.11.1/tests/test_avro_1906.c: In function 'test_n_records':
/tmp/avro-c-1.11.1/tests/test_avro_1906.c:172:6: warning: unused variable 'res' [-Wunused-variable]
int res = 0;
^~~
[ 62%] Linking C executable quickstop

...

@dainperkins
Copy link

I got this to work (for pmacctd anyway) with a simple arm image using alpine & apk to install, its currently chugging away on my ubiquiti udmpro. If anyone wants the image I'll put the dockerfile in a repo and make the docker image public.

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

No branches or pull requests

4 participants