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

feat: Improved arm64 support, add missing docs #1480

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

DRK3
Copy link
Collaborator

@DRK3 DRK3 commented Sep 13, 2022

  • BDD tests are no longer hardcoded to use the amd64 binary for CLI commands. They now select between amd64 and arm64 based on the running system's detected architecture.
  • Updated the Makefile's extract-orb-cli-binaries target to extract the arm64 binaries (they were being built before but were never extracted).
  • Resolved a warning from Docker that would get printed when running the generate-test-keys Makefile target on an arm64 system. The warning from Docker alerts you that the image for frapsoft/openssl is for amd64, which doesn't match the system you're on. To resolve the warning, you have to either use an image that matches the system architecture, or explicitly state the platform using the --platform flag. In this case, there is only an amd64 version of frapsoft/openssl, so I added the explicit flag to resolve the warning. I also added a TODO for us to find an arm64 alternative in the future (although the amd64 version of frapsoft/openssl does seem to work fine on arm64 Mac OS currently, presumably due to Apple's Rosetta translation layer or some other emulation layer).
  • Updated the documentation for the BDD tests to indicate that some hosts file entries are required for some tests to function correctly and to add some clarification+extra detail regarding the PostgreSQL Command Line Tools.

Signed-off-by: Derek Trider Derek.Trider@securekey.com

@cla-bot cla-bot bot added the cla-signed label Sep 13, 2022
@DRK3 DRK3 marked this pull request as ready for review September 13, 2022 02:56
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Merging #1480 (cdbce36) into main (c2a5373) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1480      +/-   ##
==========================================
- Coverage   87.83%   87.82%   -0.02%     
==========================================
  Files         210      210              
  Lines       19760    19763       +3     
==========================================
  Hits        17356    17356              
- Misses       1545     1546       +1     
- Partials      859      861       +2     
Impacted Files Coverage Δ
cmd/orb-server/startcmd/start.go 68.78% <0.00%> (-0.21%) ⬇️
pkg/observer/pubsub.go 94.49% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@DRK3 DRK3 force-pushed the ARMCLIAndDocs branch 2 times, most recently from 1a380ad to db562b6 Compare September 13, 2022 03:09
@@ -623,6 +623,7 @@ func (d *CommonSteps) httpPostFileWithSignatureAndExpectedCode(url, path, pubKey
}

func (d *CommonSteps) httpPost(url, data, contentType string) error {
println(fmt.Sprintf("!!!DEREK in httpPost step method"))
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this msg

Copy link
Collaborator Author

@DRK3 DRK3 Sep 13, 2022

Choose a reason for hiding this comment

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

Oops, I didn't mean to commit this. I removed it.

@@ -632,12 +633,16 @@ func (d *CommonSteps) httpPost(url, data, contentType string) error {

data = resolved.(string)

println(fmt.Sprintf("!!!DEREK in httpPost step method, url=[%s], data=[%s], contentType=[%s]", url, data, contentType))
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this msg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, I didn't mean to commit this. I removed it.

resp, err := d.doHTTPPost(url, []byte(data), contentType)
if err != nil {
return err
}

if resp.StatusCode != http.StatusOK {
println(fmt.Sprintf("!!!DEREK in httpPost step method, did not get status OK, url=[%s], data=[%s], contentType=[%s]", url, data, contentType))
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this msg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, I didn't mean to commit this. I removed it.

@@ -252,7 +252,7 @@ func (d *CommonSteps) jsonPathOfBoolResponseEquals(path, expected string) error
return nil
}

return fmt.Errorf("JSON path resolves to [%s] which is not the expected value [%s]", strBool, expected)
return fmt.Errorf("JSON path resolves to [%s] which is not the expected value [%s], !!!DEREK response was [%s]", strBool, expected, d.state.getResponse())
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this msg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, I didn't mean to commit this. I removed it.

@@ -83,7 +85,7 @@ func TestMain(m *testing.M) {
panic(fmt.Sprintf("Error composing system in BDD context: %s", err))
}

testSleep := 120
testSleep := 180
Copy link
Contributor

Choose a reason for hiding this comment

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

why increase to 180?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was doing this locally for some testing - I didn't mean to commit this. I reverted back to 120.

@@ -52,6 +52,8 @@ func TestMain(m *testing.M) {
tags = cmdTags.Value.String()
}

println("tags to use are ", tags)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this msg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, I didn't mean to commit this. I removed it.

* BDD tests are no longer hardcoded to use the amd64 binary for CLI commands. They now select between amd64 and arm64 based on the running system's detected architecture.
* Updated the Makefile's extract-orb-cli-binaries target to extract the arm64 binaries (they were being built before but were never extracted).
* Resolved a warning from Docker that would get printed when running the generate-test-keys Makefile target on an arm64 system. The warning from Docker alerts you that the image for frapsoft/openssl is for amd64, which doesn't match the system you're on. To resolve the warning, you have to either use an image that matches the system architecture, or explicitly state the platform using the --platform flag. In this case, there is only an amd64 version of frapsoft/openssl, so I added the explicit flag to resolve the warning. I also added a TODO for us to find an arm64 alternative in the future (although the amd64 version of frapsoft/openssl does seem to work fine on arm64 Mac OS currently, presumably due to Apple's Rosetta translation layer or some other emulation layer).
* Updated the documentation for the BDD tests to indicate that some hosts file entries are required for some tests to function correctly and to add some clarification+extra detail regarding the PostgreSQL Command Line Tools.

Signed-off-by: Derek Trider <Derek.Trider@securekey.com>
@bstasyszyn bstasyszyn merged commit dc4be2e into trustbloc:main Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants