Skip to content

Conversation

@pjohnst5
Copy link
Contributor

@pjohnst5 pjohnst5 commented Sep 2, 2021

Reason for Change:
We need to build an ARM64 version of CNI too now.
Validation on an ARM64 machine:

azureuser@test-vm:~$ lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              32
On-line CPU(s) list: 0-31
Thread(s) per core:  1
Core(s) per socket:  32
Socket(s):           1
NUMA node(s):        1
Vendor ID:           Cavium
Model:               2
Model name:          ThunderX2 99xx
Stepping:            0x1
BogoMIPS:            400.00
NUMA node0 CPU(s):   0-31
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
azureuser@test-vm:~$ sudo ./azure-vnet
v1.4.11

And when I try running an amd64`cni binary on an arm64 machine, it fails

azureuser@test-vm:~$ sudo amd64/azure-vnet
amd64/azure-vnet: 3: amd64/azure-vnet: Syntax error: end of file unexpected (expecting ")")

@rbtr
Copy link
Collaborator

rbtr commented Sep 3, 2021

rather than new build steps, could the existing build steps be updated to take a matrix of build args? it seems unlikely that this is the last GOOS or GOARCH change we will ever have to make, and that would:

  • reduce the existing build stages since we don't really need separate steps for different GOOS/GOARCH
  • give us a head start on having arm64 builds for all the rest of our components.

@pjohnst5
Copy link
Contributor Author

pjohnst5 commented Sep 3, 2021

Hi Evan, what would that look like? I like the idea, just don't really know what it would look like

@rbtr
Copy link
Collaborator

rbtr commented Sep 3, 2021

I think this could be as easy as adding a make target to the effect of make all-binaries-multiplatform that takes arrays of GOOS and GOARCH values, something like

make all-binaries-multiplatform GOOSES=linux,windows GOARCHES=arm64,amd64

then that make target could iterate those arrays to build the matrix of build targets, and just call the existing make targets with update build args:

all-binaries-multiplatform:
	for goos in $(GOOSES):
		for goarch in $(GOARCHES):
			$(MAKE) all-binaries GOOS=$$goos GOARCH=$$goarch

but...in actual shell script😁

Copy link
Collaborator

@rbtr rbtr left a comment

Choose a reason for hiding this comment

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

blocking on discussed multiplatform change

@pjohnst5
Copy link
Contributor Author

pjohnst5 commented Sep 3, 2021

Trying out the for loop way, where we pass in GOOS=linux,windows GOARCH=amd64,arm64

Copy link
Collaborator

@rbtr rbtr left a comment

Choose a reason for hiding this comment

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

multiplat target looks good 💯 just a couple cleanup things around it

Copy link
Collaborator

@rbtr rbtr left a comment

Choose a reason for hiding this comment

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

lgtm

@pjohnst5 pjohnst5 merged commit 36d975b into Azure:master Sep 8, 2021
@pjohnst5 pjohnst5 deleted the arm64-cni branch September 8, 2021 21:46
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