Package: airbyte-source-azure-blob-storage
Azure Blob Storage SourceThis is the repository for the Azure Blob Storage source connector, written in Python.
For information about how to use this connector within Airbyte, seethe documentation.To iterate on this connector, make sure to complete this prerequisites section.From this connector directory, create a virtual environment:python -m venv .venvThis will generate a virtualenv for this module in.venv/. Make sure this venv is active in your
development environment of choice. To activate it from the terminal, run:source .venv/bin/activate
pip install -r requirements.txtIf you are in an IDE, follow your IDE's instructions to activate the virtualenv.Note that while we are installing dependencies fromrequirements.txt, you should only editsetup.pyfor your dependencies.requirements.txtis
used for editable installs (pip install -e) to pull in Python dependencies from the monorepo and will callsetup.py.
If this is mumbo jumbo to you, don't worry about it, just put your deps insetup.pybut install usingpip install -r requirements.txtand everything
should work as you expect.If you are a community contributor, follow the instructions in thedocumentationto generate the necessary credentials. Then create a filesecrets/config.jsonconforming to thesource_azure_blob_storage/spec.yamlfile.
Note that thesecretsdirectory is gitignored by default, so there is no danger of accidentally checking in sensitive information.
Seeintegration_tests/sample_config.jsonfor a sample config file.If you are an Airbyte core member, copy the credentials in Lastpass under the secret namesource azure-blob-storage test credsand place them intosecrets/config.json.python main.py spec
python main.py check --config secrets/config.json
python main.py discover --config secrets/config.json
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.jsonThe Airbyte way of building this connector is to use ourairbyte-citool.
You can follow install instructionshere.
Then running the following command will build your connector:airbyte-ciconnectors--name=source-azure-blob-storagebuildOnce the command is done, you will find your connector image in your local docker registry:airbyte/source-azure-blob-storage:dev.When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
You can customize our build process by adding abuild_customization.pymodule to your connector.
This module should contain apre_connector_installandpost_connector_installasync function that will mutate the base image and the connector container respectively.
It will be imported at runtime by our build process and the functions will be called if they exist.Here is an example of abuild_customization.pymodule:from__future__importannotationsfromtypingimportTYPE_CHECKINGifTYPE_CHECKING:fromdaggerimportContainerasyncdefpre_connector_install(base_image_container:Container)->Container:returnawaitbase_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR","my_pre_build_env_var_value")asyncdefpost_connector_install(connector_container:Container)->Container:returnawaitconnector_container.with_env_variable("MY_POST_BUILD_ENV_VAR","my_post_build_env_var_value")This connector is built using our dynamic built process inairbyte-ci.
The base image used to build it is defined within the metadata.yaml file under theconnectorBuildOptions.
The build logic is defined usingDaggerhere.
It does not rely on a Dockerfile.If you would like to patch our connector and build your own a simple approach would be to:Create your own Dockerfile based on the latest version of the connector image.FROMairbyte/source-azure-blob-storage:latestCOPY../airbyte/integration_codeRUNpipinstall./airbyte/integration_codePlease use this as an example. This is not optimized.Build your image:dockerbuild-tairbyte/source-azure-blob-storage:dev.
dockerrunairbyte/source-azure-blob-storage:devspecThen run any of the connector commands as follows:docker run --rm airbyte/source-azure-blob-storage:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-azure-blob-storage:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-azure-blob-storage:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.jsonYou can run our full test suite locally usingairbyte-ci:airbyte-ciconnectors--name=source-azure-blob-storagetestCustomizeacceptance-test-config.ymlfile to configure tests. SeeConnector Acceptance Testsfor more information.
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.All of your dependencies should go insetup.py, NOTrequirements.txt. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
We split dependencies between two groups, dependencies that are:required for your connector to work need to go toMAIN_REQUIREMENTSlist.required for the testing need to go toTEST_REQUIREMENTSlistYou've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?Make sure your changes are passing our test suite:airbyte-ci connectors --name=source-azure-blob-storage testBump the connector version inmetadata.yaml: increment thedockerImageTagvalue. Please followsemantic versioning for connectors.Make sure themetadata.yamlcontent is up to date.Make the connector documentation and its changelog is up to date (docs/integrations/sources/azure-blob-storage.md).Create a Pull Request: useour PR naming conventions.Pat yourself on the back for being an awesome contributor.Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.