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

Azure blob read/write integration test #7024

Merged
merged 37 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3a06506
Initial Blob Storage Read Test
kraefrei Mar 1, 2023
0abca4b
Fix read test for azure
kraefrei Mar 1, 2023
7a20b31
Add log workflow option to test
kraefrei Mar 6, 2023
ee4bb69
Merge branch 'develop' into WX-935
THWiseman Mar 10, 2023
0e107ba
added environment variables to CI
THWiseman Mar 10, 2023
28a3507
new script
THWiseman Mar 10, 2023
b7dd69e
denied
THWiseman Mar 10, 2023
21a4e93
permissions
THWiseman Mar 10, 2023
1b35ceb
testing
THWiseman Mar 10, 2023
578f3a7
testing
THWiseman Mar 10, 2023
ccde773
i
THWiseman Mar 10, 2023
91f7f72
per
THWiseman Mar 10, 2023
33aad95
testing
THWiseman Mar 13, 2023
196925f
testing
THWiseman Mar 13, 2023
cab62aa
change
THWiseman Mar 13, 2023
d5da50b
testing
THWiseman Mar 13, 2023
1717090
testy'
THWiseman Mar 13, 2023
e709eac
testi
THWiseman Mar 13, 2023
3d53660
testing
THWiseman Mar 14, 2023
fd8f65b
stomething
THWiseman Mar 14, 2023
44534da
something
THWiseman Mar 14, 2023
8b7c4f3
testing
THWiseman Mar 14, 2023
ccea5a4
testing
THWiseman Mar 14, 2023
d585005
testing
THWiseman Mar 14, 2023
a1ba566
test
THWiseman Mar 14, 2023
0f0c481
emtpy
THWiseman Mar 14, 2023
1ccf705
testing
THWiseman Mar 14, 2023
05d5168
cleanup
THWiseman Mar 15, 2023
8c9b37f
h
THWiseman Mar 15, 2023
f1e09e4
h
THWiseman Mar 15, 2023
de2bf9b
h
THWiseman Mar 15, 2023
958db3c
newdir
THWiseman Mar 15, 2023
0b80d19
h
THWiseman Mar 15, 2023
bcd11a5
remove
THWiseman Mar 15, 2023
097985f
Merge branch 'develop' into WX-935
THWiseman Mar 15, 2023
3407a08
Merge branch 'develop' into WX-935
kraefrei Mar 23, 2023
70913a0
Add comment to clarify the config
kraefrei Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
- build_type: centaurSlurm
build_mysql: 5.7
friendly_name: "Centaur Slurm with MySQL 5.7"
- build_type: centaurBlob
build_mysql: 5.7
friendly_name: Centaur Blob
name: ${{ matrix.friendly_name }}
env:
BUILD_NAME: ${{ matrix.build_type }}
Expand All @@ -72,6 +75,9 @@ jobs:
BUILD_MARIADB: ${{ matrix.build_mariadb }}
VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID_CI }}
VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID_CI }}
AZURE_CLIENT_ID: ${{ secrets.VAULT_AZURE_CENTAUR_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.VAULT_AZURE_CENTAUR_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.VAULT_AZURE_CENTAUR_TENANT_ID }}
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ actual.json
console_output.txt
expected.json
run_mode_metadata.json
https:/**
THWiseman marked this conversation as resolved.
Show resolved Hide resolved

# custom config
cromwell-executions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: azure_blob_storage_read
testFormat: workflowsuccess
backends: [Local]
tags: ["blob", "azure"]
retryTestFailures: false

files {
workflow: azure_blob_storage_read/azure_blob_storage_read.wdl
inputs: azure_blob_storage_read/azure_blob_storage_read.inputs
options: azure_blob_storage_read/azure_blob_storage_read.options
}

metadata {
status: Succeeded
"outputs.azure_blob_storage_read.s1": "This is my test file! Did it work??"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"azure_blob_storage_read.file1": "https://centaurtesting.blob.core.windows.net/test-blob/testRead.txt"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"final_workflow_log_dir": "https://centaurtesting.blob.core.windows.net/test-blob/test-cromwell-workflow-logs"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version 1.0

workflow azure_blob_storage_read {

input {
File file1
}

output {
String s1 = read_string(file1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like running this workflow doesn't result in any files being written to the blob container, is that right? Can we use a slightly more complicated workflow that will use the Local filesystem rather than TES, and execute a task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does result in a log being written to the storage container with the supplied options. I can work on a different wdl though to run a task locally if you think thats a clearer test!

Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems better to exercise all parts of the system. I know I'm late to the party here, if it ends up not being an easy change I'm fine calling it out of scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This ended up being a more difficult change because the Local backend doesn't easily support working on filesystems other than the local one. For now I think this may need to wait.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ case class NativeBlobSasTokenGenerator(container: BlobContainerName, endpoint: E
private def authenticateWithSubscription(sub: SubscriptionId) = AzureResourceManager.authenticate(azureCredentialBuilder, azureProfile).withSubscription(sub.toString)
private def authenticateWithDefaultSubscription = AzureResourceManager.authenticate(azureCredentialBuilder, azureProfile).withDefaultSubscription()
private def azure = subscription.map(authenticateWithSubscription(_)).getOrElse(authenticateWithDefaultSubscription)

private def findAzureStorageAccount(name: StorageAccountName) = azure.storageAccounts.list.asScala.find(_.name.equals(name.value))
.map(Success(_)).getOrElse(Failure(new Exception("Azure Storage Account not found")))
private def buildBlobContainerClient(credential: StorageSharedKeyCredential, endpoint: EndpointURL, container: BlobContainerName): BlobContainerClient = {
Expand Down
7 changes: 7 additions & 0 deletions src/ci/bin/test.inc.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ cromwell::private::create_build_variables() {
centaurHoricromtalEngineUpgrade*)
CROMWELL_BUILD_CROMWELL_CONFIG="${CROMWELL_BUILD_RESOURCES_DIRECTORY}/papi_v2alpha1_horicromtal_application.conf"
;;
centaurBlob*)
CROMWELL_BUILD_CROMWELL_CONFIG="${CROMWELL_BUILD_RESOURCES_DIRECTORY}/centaur_blob_test.conf"
;;
*)
CROMWELL_BUILD_CROMWELL_CONFIG="${CROMWELL_BUILD_RESOURCES_DIRECTORY}/${CROMWELL_BUILD_BACKEND_TYPE}_application.conf"
;;
Expand Down Expand Up @@ -595,6 +598,7 @@ cromwell::private::create_centaur_variables() {
CROMWELL_BUILD_CENTAUR_TYPE_PAPI_UPGRADE_NEW_WORKFLOWS="papiUpgradeNewWorkflows"
CROMWELL_BUILD_CENTAUR_TYPE_HORICROMTAL_ENGINE_UPGRADE="horicromtalEngineUpgrade"
CROMWELL_BUILD_CENTAUR_TYPE_HORICROMTAL="horicromtal"
CROMWELL_BUILD_CENTAUR_TYPE_AZURE_BLOB="azureBlob"

case "${CROMWELL_BUILD_TYPE}" in
centaurEngineUpgrade*)
Expand All @@ -612,6 +616,9 @@ cromwell::private::create_centaur_variables() {
centaurHoricromtal*)
CROMWELL_BUILD_CENTAUR_TYPE="${CROMWELL_BUILD_CENTAUR_TYPE_HORICROMTAL}"
;;
centaurBlob*)
CROMWELL_BUILD_CENTAUR_TYPE="${CROMWELL_BUILD_CENTAUR_TYPE_AZURE_BLOB}"
;;
*)
# Only set the type if Jenkins, etc. has not already set the centaur type
if [[ -z "${CROMWELL_BUILD_CENTAUR_TYPE-}" ]]; then
Expand Down
18 changes: 18 additions & 0 deletions src/ci/bin/testCentaurBlob.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail
# import in shellcheck / CI / IntelliJ compatible ways
# shellcheck source=/dev/null
source "${BASH_SOURCE%/*}/test.inc.sh" || source test.inc.sh

#NB: This function ensures that the correct .conf file is being used by cromwell (among other things).
#Blob storage requires a configuration file tailored for Azure.
cromwell::build::setup_common_environment

cromwell::build::setup_centaur_environment

cromwell::build::assemble_jars

cromwell::build::run_centaur

cromwell::build::generate_code_coverage
64 changes: 64 additions & 0 deletions src/ci/resources/centaur_blob_test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
include required(classpath("application.conf"))
include "build_application.inc.conf"

filesystems {
blob {
class = "cromwell.filesystems.blob.BlobPathBuilderFactory"
global {
# One BFSM is shared across all BlobPathBuilders
class = "cromwell.filesystems.blob.BlobFileSystemManager"
config {
container: "test-blob"
endpoint: "https://centaurtesting.blob.core.windows.net"
subscription: "62b22893-6bc1-46d9-8a90-806bb3cce3c9"
}
}
}
}

engine {
filesystems {
local {
enabled: false
}
http {
enabled: false
}
blob {
enabled: true
}
}
}


backend {
default = "TES"
providers {
TES {
actor-factory = "cromwell.backend.impl.tes.TesBackendLifecycleActorFactory"
config {
# Use for running on blob storage
#root = "https://<storage-account>.blob.core.windows.net/cromwell/cromwell-executions"
root = "cromwell-executions"
dockerRoot = "/cromwell-executions"
endpoint = "http://127.0.0.1:9000/v1/tasks"
concurrent-job-limit = 1000
transform-blob-to-local-path = false
filesystems {
blob {
enabled: true
}
local {
enabled: true
}
http {
enabled: true
jgainerdewar marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

# Have the engine (maybe) authenticate to docker.io. See BT-141 for more info.
include "dockerhub_provider_config_v1.inc.conf"
}
}
}