Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
cca9bcd
Add buildkite pipeline for pypi publishing
lorenabalan Oct 3, 2025
a5b3b0d
Fix notice check
lorenabalan Oct 3, 2025
c50d937
Consolidate tools config in pyproject.toml
lorenabalan Oct 3, 2025
b7ca75d
Blank line
lorenabalan Oct 3, 2025
27f1377
Add manual confirmation step for now
lorenabalan Oct 3, 2025
4dd68c5
Update manual release pipeline
lorenabalan Oct 3, 2025
1db805a
Update current pipeline
lorenabalan Oct 3, 2025
f06b27b
Restore notice
lorenabalan Oct 3, 2025
f4b96cf
Add missing package_path
lorenabalan Oct 3, 2025
bc9d3e2
Update NOTICE.txt
elasticmachine Oct 3, 2025
aac7627
Merge branch 'lb/pypi-pipeline' of github.com:elastic/connectors into…
lorenabalan Oct 3, 2025
3ad00aa
Fix lint
lorenabalan Oct 3, 2025
ab30eb8
Run package check quicker
lorenabalan Oct 3, 2025
d41045c
Add license as per PEP621
lorenabalan Oct 3, 2025
43edc13
Add connectors* to packages.find
lorenabalan Oct 3, 2025
34f2b71
Update NOTICE.txt
elasticmachine Oct 3, 2025
f2a63ce
Update license
lorenabalan Oct 3, 2025
eb5072a
Make build check work on Python 3.11
lorenabalan Oct 3, 2025
8036357
Update NOTICE.txt
elasticmachine Oct 3, 2025
97b52fd
Merge branch 'develop' into lb/pypi-pipeline
lorenabalan Oct 3, 2025
ee069dd
Merge branch 'lb/pypi-pipeline' of github.com:elastic/connectors into…
lorenabalan Oct 3, 2025
5b5c13b
Fixxxxx notice
lorenabalan Oct 3, 2025
8619c1e
Update NOTICE.txt
elasticmachine Oct 3, 2025
23f7632
Correct buildkite label
lorenabalan Oct 6, 2025
d7f7a96
Use script in pypi-publish pipeline too
lorenabalan Oct 6, 2025
ccfd0f3
Update NOTICE.txt
elasticmachine Oct 6, 2025
a659961
Use script to publish to PyPIs
lorenabalan Oct 6, 2025
60b2cd5
Merge branch 'lb/pypi-pipeline' of github.com:elastic/connectors into…
lorenabalan Oct 6, 2025
fa92b6b
Add new buildkite pipeline to catalog
lorenabalan Oct 7, 2025
53c130a
Typo
lorenabalan Oct 7, 2025
915bb5a
Test CLI
lorenabalan Oct 8, 2025
684d3d3
Fix CLI
lorenabalan Oct 8, 2025
5156e7f
Fix tests CLI
lorenabalan Oct 8, 2025
8c02e68
Install from binary distribution instead of from local source
lorenabalan Oct 8, 2025
ae00648
Update NOTICE.txt
elasticmachine Oct 21, 2025
da28bf4
Publish only one whl
lorenabalan Oct 21, 2025
1035993
Blank line
lorenabalan Oct 21, 2025
feff713
Merge branch 'develop' into lb/pypi-pipeline
lorenabalan Oct 21, 2025
af056ad
Update NOTICE.txt
elasticmachine Oct 21, 2025
cdc9e7a
Publish binary and source distributions as DRAs
lorenabalan Oct 21, 2025
949d528
Merge branch 'lb/pypi-pipeline' of github.com:elastic/connectors into…
lorenabalan Oct 21, 2025
671ddf9
Rename
lorenabalan Oct 22, 2025
e8f92d3
Fix ftests
lorenabalan Oct 22, 2025
92dae7c
Comment out real pypi publishing
lorenabalan Oct 22, 2025
ec4d050
Rename step, update Dockerfile
lorenabalan Oct 24, 2025
ee2d136
Update version
lorenabalan Oct 24, 2025
ad1e6e2
Update NOTICE.txt
elasticmachine Oct 24, 2025
f7ec4f6
Merge branch 'develop' into lb/pypi-pipeline
lorenabalan Oct 24, 2025
51d3e46
Update pyproject.toml
lorenabalan Oct 27, 2025
6a2d1b2
Update license
lorenabalan Oct 27, 2025
d04d9c6
Update NOTICE.txt
elasticmachine Oct 27, 2025
4d185fe
Add search-eng team to bk pipeline
lorenabalan Oct 27, 2025
072855a
Use DRA_ARTIFACTS_DIR everywhere
lorenabalan Oct 27, 2025
df3f4d6
Update Vault path
lorenabalan Oct 27, 2025
e27a7ae
Small package test
lorenabalan Oct 28, 2025
2024377
pedantic reorg of cp statements (#3813)
seanstory Oct 28, 2025
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
28 changes: 26 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,29 @@ steps:
artifact_paths:
- "perf8-report-*/**/*"

- group: ":building_construction: Build and Test Python Packages"
key: "test_packages"
steps:
- label: ":python: Build Python {{matrix.python_version}} {{matrix.package_path}} package"
key: build_python_package
<<: *test-agents
matrix:
setup:
python_version:
- "3.10"
- "3.11"
package_path:
- "app/connectors_service"
- "libs/connectors_sdk"
env:
PYTHON_VERSION: "{{ matrix.python_version }}"
PACKAGE_PATH: "{{ matrix.package_path }}"
command: ".buildkite/test_python_packages.sh"
artifact_paths:
- "{{ matrix.package_path }}/dist/*.whl"
- "{{ matrix.package_path }}/dist/*.tar.gz"
timeout_in_minutes: 10

# ----
# DRA publishing
# ----
Expand All @@ -635,6 +658,7 @@ steps:
- "unit_tests"
- "smoke_test"
- "relevant_ftests"
- "test_packages"
steps:
# ----
# Docker builds for amd64
Expand Down Expand Up @@ -699,7 +723,7 @@ steps:
- ".buildkite/publish/test-docker.sh"

# ----
# OSS Dockerfile build, tests and vunlerability scan on amd64
# OSS Dockerfile build, tests and vulnerability scan on amd64
# ----
- label: "Building amd64 Docker image from OSS Dockerfile"
agents:
Expand Down Expand Up @@ -746,7 +770,7 @@ steps:
find .artifacts -type f -name '*.tar.gz*' -exec trivy image --quiet --input {} \;

# ----
# OSS Dockerfile build, tests and vunlerability scan on arm64
# OSS Dockerfile build, tests and vulnerability scan on arm64
# ----
- label: "Building arm64 Docker image from OSS Dockerfile"
agents:
Expand Down
31 changes: 26 additions & 5 deletions .buildkite/publish/dra/init_dra_publishing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@ cd $PROJECT_ROOT
make clean zip
export DRA_ARTIFACTS_DIR=$RELEASE_DIR/dist/dra-artifacts
mkdir -p $DRA_ARTIFACTS_DIR
cp $RELEASE_DIR/dist/elasticsearch_connectors-${VERSION}.zip $DRA_ARTIFACTS_DIR/connectors-${VERSION}.zip

cd -

# Download previous step artifacts
buildkite-agent artifact download '.artifacts/*.tar.gz*' $RELEASE_DIR/dist/ --step build_docker_image_amd64
buildkite-agent artifact download '.artifacts/*.tar.gz*' $RELEASE_DIR/dist/ --step build_docker_image_arm64
buildkite-agent artifact download 'app/connectors_service/dist/*.whl' $RELEASE_DIR/ --step test_packages
buildkite-agent artifact download 'app/connectors_service/dist/*.tar.gz' $RELEASE_DIR/ --step test_packages
buildkite-agent artifact download 'libs/connectors_sdk/dist/*.whl' $RELEASE_DIR/ --step test_packages
buildkite-agent artifact download 'libs/connectors_sdk/dist/*.tar.gz' $RELEASE_DIR/ --step test_packages


# Copy previous step artifacts to DRA dir
cp $RELEASE_DIR/dist/.artifacts/* $DRA_ARTIFACTS_DIR
cp $RELEASE_DIR/app/connectors_service/dist/* $DRA_ARTIFACTS_DIR
cp $RELEASE_DIR/libs/connectors_sdk/dist/* $DRA_ARTIFACTS_DIR

# Rename to match DRA expectations (<name>-<version>-<classifier>-<os>-<arch>)
# Rename docker images to match DRA expectations (<name>-<version>-<classifier>-<os>-<arch>)
cd $DRA_ARTIFACTS_DIR
mv $DOCKER_ARTIFACT_KEY-$VERSION-amd64.tar.gz $PROJECT_NAME-$VERSION-docker-image-linux-amd64.tar.gz
mv $DOCKER_ARTIFACT_KEY-$VERSION-arm64.tar.gz $PROJECT_NAME-$VERSION-docker-image-linux-arm64.tar.gz
Expand Down Expand Up @@ -138,9 +148,16 @@ if [[ "${PUBLISH_SNAPSHOT:-}" == "true" ]]; then
generateDependencyReport $DEPENDENCIES_REPORTS_DIR/$dependencyReportName

echo "-------- Publishing SNAPSHOT DRA Artifacts"
cp $RELEASE_DIR/dist/elasticsearch_connectors-${VERSION}.zip $DRA_ARTIFACTS_DIR/connectors-${VERSION}-SNAPSHOT.zip

# Make *-SNAPSHOT* copies
cp $DRA_ARTIFACTS_DIR/connectors-${VERSION}.zip $DRA_ARTIFACTS_DIR/connectors-${VERSION}-SNAPSHOT.zip
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION.whl $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION-SNAPSHOT.whl
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION.tar.gz $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION-SNAPSHOT.tar.gz
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION.whl $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION-SNAPSHOT.whl
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION.tar.gz $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION-SNAPSHOT.tar.gz
cp $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-docker-image-linux-amd64.tar.gz $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-SNAPSHOT-docker-image-linux-amd64.tar.gz
cp $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-docker-image-linux-arm64.tar.gz $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-SNAPSHOT-docker-image-linux-arm64.tar.gz

setDraVaultCredentials
export WORKFLOW="snapshot"

Expand All @@ -155,19 +172,23 @@ fi
if [[ "${PUBLISH_STAGING:-}" == "true" ]]; then
if [ -n "${VERSION_QUALIFIER:-}" ]; then
dependencyReportName="dependencies-${VERSION}-${VERSION_QUALIFIER}.csv";
zip_artifact_name="connectors-${VERSION}-${VERSION_QUALIFIER}.zip"

# Make *-$VERSION_QUALIFIER* copies
cp $DRA_ARTIFACTS_DIR/connectors-${VERSION}.zip $DRA_ARTIFACTS_DIR/$PROJECT_NAME-${VERSION}-${VERSION_QUALIFIER}.zip
cp $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-docker-image-linux-amd64.tar.gz $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-$VERSION_QUALIFIER-docker-image-linux-amd64.tar.gz
cp $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-docker-image-linux-arm64.tar.gz $DRA_ARTIFACTS_DIR/$PROJECT_NAME-$VERSION-$VERSION_QUALIFIER-docker-image-linux-arm64.tar.gz
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION.whl $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION-$VERSION_QUALIFIER.whl
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION.tar.gz $DRA_ARTIFACTS_DIR/elasticsearch_connectors-$VERSION-$VERSION_QUALIFIER.tar.gz
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION.whl $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION-$VERSION_QUALIFIER.whl
cp $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION.tar.gz $DRA_ARTIFACTS_DIR/elasticsearch_connectors_sdk-$VERSION-$VERSION_QUALIFIER.tar.gz
else
dependencyReportName="dependencies-${VERSION}.csv";
zip_artifact_name="connectors-${VERSION}.zip"
fi

echo "-------- Generating STAGING dependency report: ${dependencyReportName}"
generateDependencyReport $DEPENDENCIES_REPORTS_DIR/$dependencyReportName

echo "-------- Publishing STAGING DRA Artifacts"
cp $RELEASE_DIR/dist/elasticsearch_connectors-${VERSION}.zip $DRA_ARTIFACTS_DIR/${zip_artifact_name}
setDraVaultCredentials
export WORKFLOW="staging"

Expand Down
6 changes: 3 additions & 3 deletions .buildkite/publish/manual-release/update-release-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ CURDIR="$(dirname "$REL_DIR")"

source $CURDIR/publish-common.sh

echo $VERSION > $PROJECT_ROOT/connectors/VERSION # adds the timestamp suffix
UPDATED_VERSION=`cat $PROJECT_ROOT/connectors/VERSION`
echo $VERSION > $PROJECT_ROOT/app/connectors/VERSION # adds the timestamp suffix
UPDATED_VERSION=`cat $PROJECT_ROOT/app/connectors/VERSION`

git add $PROJECT_ROOT/connectors/VERSION
git add $PROJECT_ROOT/app/connectors/VERSION
git commit -m "Bumping version from ${ORIG_VERSION} to ${UPDATED_VERSION}"
git push origin ${GIT_BRANCH}

Expand Down
24 changes: 24 additions & 0 deletions .buildkite/publish_to_pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# !!! WARNING DO NOT add -x to avoid leaking vault passwords
set -euo pipefail

source .buildkite/shared.sh

init_python
cd "$PACKAGE_PATH"
python -m pip install --upgrade build twine
python -m build

export TWINE_USERNAME="__token__"

# upload to test or real PyPI based on TEST_PYPI=1 env var or arg
if [[ "${1:-}" == "TEST_PYPI=1" ]] || [[ "${TEST_PYPI:-}" =~ ^(1|TRUE|true)$ ]]; then
TWINE_PASSWORD=$(vault read -field publishing-api-key secret/ci/elastic-connectors/test-pypi)
export TWINE_PASSWORD
python -m twine upload --repository testpypi dist/*
else
TWINE_PASSWORD=$(vault read -field publishing-api-key secret/ci/elastic-connectors/pypi)
export TWINE_PASSWORD
python -m twine upload --repository pypi dist/*
fi
92 changes: 92 additions & 0 deletions .buildkite/pypi-publish-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
## .buildkite/pypi-publish-pipeline.yml
# Manually-triggered pipeline to build and publish Python packages to PyPI
notify:
- if: 'build.branch =~ /^((main)|([0-9]+\.[0-9]+))$/ && (build.state == "failed" || pipeline.started_passing)'
slack:
channels:
- "#search-et-alerts"
message: "${BUILDKITE_MESSAGE}"

# add paths for all the packages we want to build here
# then make sure they're added to the matrix.setup.package_path lists in the steps below
env:
SERVICE_PACKAGE_PATH: "app/connectors_service"
SDK_PACKAGE_PATH: "libs/connectors_sdk"

steps:
- group: ":building_construction: Build Python Packages"
key: "build_package"
steps:
- label: ":python: Build Python {{matrix.python_version}} {{matrix.package_path}} package"
key: build_python_package
agents:
provider: "gcp"
machineType: "n1-standard-8"
useVault: true
image: family/enterprise-search-ubuntu-2204-connectors-py
matrix:
setup:
python_version:
- "3.10"
- "3.11"
package_path:
- "${SERVICE_PACKAGE_PATH}"
- "${SDK_PACKAGE_PATH}"
env:
PYTHON_VERSION: "{{ matrix.python_version }}"
PACKAGE_PATH: "{{ matrix.package_path }}"
commands: ".buildkite/test_python_packages.sh"

- wait

- group: ":test_tube: Publish to Test PyPI"
key: "publish_to_test_pypi"
depends_on:
- build_package
steps:
- label: ":package: Publish to Test PyPI"
key: publish_test_pypi
agents:
provider: "gcp"
machineType: "n1-standard-8"
useVault: true
image: family/enterprise-search-ubuntu-2204-connectors-py
matrix:
setup:
package_path:
- "${SERVICE_PACKAGE_PATH}"
- "${SDK_PACKAGE_PATH}"
env:
PYTHON_VERSION: "3.11"
PACKAGE_PATH: "{{ matrix.package_path }}"
commands: "TEST_PYPI=1 ./buildkite/publish_to_pypi.sh"

# FOR WHEN WE'RE READY TO PUBLISH TO PRODUCTION PYPI
#
# - block: ":rocket: Publish to Production PyPI?"
# prompt: "Test PyPI publish succeeded. Proceed to publish to Production PyPI?"
# key: "confirm_production_publish"
# depends_on:
# - publish_to_test_pypi
#
# - group: ":truck: Publish to Production PyPI"
# key: "publish_to_pypi"
# depends_on:
# - confirm_production_publish
# steps:
# - label: ":package: Publish to Production PyPI"
# key: publish_pypi
# agents:
# provider: "gcp"
# machineType: "n1-standard-8"
# useVault: true
# image: family/enterprise-search-ubuntu-2204-connectors-py
# matrix:
# setup:
# package_path:
# - "${SERVICE_PACKAGE_PATH}"
# - "${SDK_PACKAGE_PATH}"
# env:
# PYTHON_VERSION: "3.11"
# PACKAGE_PATH: "{{ matrix.package_path }}"
# commands: ".buildkite/publish_to_pypi.sh"
4 changes: 2 additions & 2 deletions .buildkite/release-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ steps:
key: "release_setup"
steps:
# ----
# Set the build timestamp (for the verion suffix)
# Set the build timestamp (for the version suffix)
# ---
- label: "Set build metadata"
commands:
- buildkite-agent meta-data set timestamp "$(date -u +'%Y%m%d%H%M')"
- buildkite-agent meta-data set orig_version "$(cat connectors/VERSION)"
- buildkite-agent meta-data set orig_version "$(cat app/connectors/VERSION)"
key: set_timestamp
- wait
- label: ":github: update version and tag"
Expand Down
32 changes: 32 additions & 0 deletions .buildkite/test_python_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# !!! WARNING DO NOT add -x to avoid leaking vault passwords
set -euo pipefail

source .buildkite/shared.sh

init_python

python -m pip install --upgrade build twine
python -m build "$PACKAGE_PATH"
ls -lah "$PACKAGE_PATH/dist/"
python -m twine check "$PACKAGE_PATH/dist/*"

# If this is the connectors_service package, test the installation and CLI
if [[ "$PACKAGE_PATH" == *app/connectors_service* ]]; then
echo "Testing connectors_service package installation and CLI..."

# Install the connectors_sdk package first
LIB_PATH="libs/connectors_sdk"
python -m build "$LIB_PATH"
python -m pip install "$LIB_PATH"/dist/*.whl

python -m pip install "$PACKAGE_PATH"/dist/*.whl
connectors --help
elastic-ingest --help
# elastic-agent-connectors --help
test-connectors --help
else
python -m pip install "$PACKAGE_PATH"/dist/*.whl
python -c "import connectors_sdk; print(f'🎉 Success! connectors_sdk version: {connectors_sdk.__version__}')"
fi
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ COPY --chown=nonroot:nonroot . /app

USER nonroot
WORKDIR /app
RUN make clean install
RUN ln -s .venv/bin /app/bin
RUN make clean install-package
RUN ln -s app/connectors_service/.venv/bin /app/bin

USER root
RUN apk del make git
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.wolfi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM docker.elastic.co/wolfi/python:3.11-dev@sha256:c85a849c182a812950c3036b3965
USER root
COPY . /app
WORKDIR /app
RUN make clean install
RUN ln -s .venv/bin /app/bin
RUN make clean install-package
RUN ln -s app/connectors_service/.venv/bin /app/bin
ENTRYPOINT []
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ install:
cd $(connectors_sdk_dir); make install
cd $(app_dir); make install

install-package:
cd $(connectors_sdk_dir); make install-package
cd $(app_dir); make install-package

test: install
cd $(connectors_sdk_dir); make test
cd $(app_dir); make test
Expand Down
31 changes: 0 additions & 31 deletions app/connectors_service/.ruff.toml

This file was deleted.

Loading