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

Use file loader without local cache in the upload server #755

Merged
merged 22 commits into from
May 30, 2023

Conversation

csegarragonz
Copy link
Collaborator

@csegarragonz csegarragonz commented May 23, 2023

The behaviour of the upload server should be that, irrespective of whether the user/function has been uploaded before, the WASM bytes and the machine code are re-generated and uploaded to S3.

To achieve this goal, at some point in the past we introduced the file loader without local cache. As a reminder, the default behaviour of the file loader is to cache files in the local filesystem.

However, we were only using the file loader without cache to upload the WASM bytes, but not to generate the machine code. A MachineCodeGenerator instance takes a FileLoader in its constructor which, before, was configured to use the local cache.

This means that, even though the WASM file was uploaded, the generated machine code (which was later on uploaded to S3) corresponded to a potentially old WASM file. This was causing issues and making the quick-start tests fail. (Why this was not caught in the GHA is a different story that I cover in #746).

In this PR I fix this issue by explicitly giving getMachineCodeGenerator a FileLoader& and add a regression test. I also update the FunctionLoaderTestFixture to run upload tests for different WASM VMs.

@@ -221,6 +221,76 @@ TEST_CASE_METHOD(UploadTestFixture, "Test upload and download", "[upload]")
}
}

TEST_CASE_METHOD(UploadTestFixture,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This test fails against the current main branch

@csegarragonz csegarragonz changed the title Use cache-less loader in the upload server Use file loader without local cache in the upload server May 23, 2023
@csegarragonz csegarragonz self-assigned this May 23, 2023
@csegarragonz csegarragonz force-pushed the upload-no-cache branch 4 times, most recently from 7a62cc5 to 2420adb Compare May 26, 2023 10:18
@@ -49,17 +55,17 @@ std::vector<uint8_t> MachineCodeGenerator::hashBytes(
}

std::vector<uint8_t> MachineCodeGenerator::doCodegen(
std::vector<uint8_t>& bytes,
const std::string& fileName,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two arguments in the argument list were not used, so I remove them.

@csegarragonz csegarragonz merged commit f54ec38 into main May 30, 2023
13 checks passed
@csegarragonz csegarragonz deleted the upload-no-cache branch May 30, 2023 15:21
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.

None yet

1 participant