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: migrating off of CircleCI #638

Merged
merged 29 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d0cea7d
saving state of noxfile prior to owlbot.py edits
chalmerlowe Jun 21, 2023
9dd6eb5
minor clean up of leftover artifacts from various experiments
chalmerlowe Jun 21, 2023
e8a5512
linting and black
chalmerlowe Jun 21, 2023
e88a4f9
adds noxfile.py to excludes and removes noxfile edits in owlbot
chalmerlowe Jun 23, 2023
53bd3d8
Adds new kokoro file in presubmit
chalmerlowe Jun 23, 2023
cb6ecfd
removes circle/ci config file
chalmerlowe Jun 27, 2023
eb4714e
Merge branch 'main' into circleci-migration
chalmerlowe Jul 5, 2023
b56f0d7
Merge branch 'main' into circleci-migration
chalmerlowe Jul 6, 2023
0b66029
Merge branch 'main' into circleci-migration
chalmerlowe Jul 7, 2023
9045c1c
Update noxfile.py
chalmerlowe Jul 10, 2023
fcdd477
Update noxfile.py
chalmerlowe Jul 12, 2023
1a5e26a
Update noxfile.py
chalmerlowe Jul 12, 2023
b8d9b2a
remove limit on printing only KOKORO env variables (for testing)
chalmerlowe Jul 12, 2023
5c925c9
updates build.sh with conda environmental variables
chalmerlowe Jul 13, 2023
90b72ff
updates build.sh with conda environmental variables redux
chalmerlowe Jul 13, 2023
9d6bade
removes the ci folder and files related to circle ci
chalmerlowe Jul 13, 2023
da3eaf2
updates env variable to display all vars not just KOKORO
chalmerlowe Jul 13, 2023
eeeff05
removes additional content related to circle ci
chalmerlowe Jul 13, 2023
0db7bde
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 13, 2023
cf2e40a
updates owlbot with build.sh edits
chalmerlowe Jul 13, 2023
a07b46b
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 13, 2023
4bf7389
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 13, 2023
7f3eb4b
Merge branch 'circleci-migration' of https://github.com/googleapis/py…
gcf-owl-bot[bot] Jul 13, 2023
1882651
updates owlbot with build.sh minor tweak
chalmerlowe Jul 13, 2023
4f375a2
revert build.sh
chalmerlowe Jul 13, 2023
3f6d739
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 13, 2023
1a7531a
testing regex change
chalmerlowe Jul 13, 2023
5f6366e
revert build.sh
chalmerlowe Jul 13, 2023
f0423fb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 13, 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
34 changes: 0 additions & 34 deletions .circleci/config.yml

This file was deleted.

11 changes: 10 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
export CONDA_EXE=/root/conda/bin/conda
export CONDA_PREFIX=/root/conda
export CONDA_PROMPT_MODIFIER=(base)
export _CE_CONDA=
export CONDA_SHLVL=1
export CONDA_PYTHON_EXE=/root/conda/bin/python
export CONDA_DEFAULT_ENV=base
export PATH=/root/conda/bin:/root/conda/condabin:${PATH}


# Debug: show build environment
env | grep KOKORO
env

# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
Expand Down
7 changes: 7 additions & 0 deletions .kokoro/presubmit/conda_test.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "conda_test"
}
13 changes: 0 additions & 13 deletions ci/config_auth.sh

This file was deleted.

17 changes: 0 additions & 17 deletions ci/requirements-3.7-0.24.2.conda

This file was deleted.

14 changes: 0 additions & 14 deletions ci/requirements-3.9-1.3.4.conda

This file was deleted.

23 changes: 0 additions & 23 deletions ci/run_conda.sh

This file was deleted.

15 changes: 0 additions & 15 deletions ci/run_tests.sh

This file was deleted.

81 changes: 81 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

DEFAULT_PYTHON_VERSION = "3.8"


UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand All @@ -51,6 +52,11 @@
"3.9": [],
}

CONDA_TEST_PYTHON_VERSIONS = [
UNIT_TEST_PYTHON_VERSIONS[0],
UNIT_TEST_PYTHON_VERSIONS[-1],
]

SYSTEM_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down Expand Up @@ -514,3 +520,78 @@ def prerelease_deps(session):
system_test_folder_path,
*session.posargs,
)


def install_conda_unittest_dependencies(session, standard_deps, conda_forge_packages):
"""Installs packages from conda forge, pypi, and locally."""

# Install from conda-forge and default conda package repos.
session.conda_install(*conda_forge_packages, channel=["defaults", "conda-forge"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

If both default and conda-forge have a package, would we get the version from conda-forge or default? IMO, we should prefer conda-forge since those packages are updated more frequently in general.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. I don't know the answer yet. I will look it up and see if there is a way to identify a preference for source.

Not gonna hold up the PR for this though. If a change is needed, will add to a separate PR.


# Install from pypi for packages not readily available on conda forge.
session.install(
*standard_deps,
)

# Install via pip from the local repo, avoid doing dependency resolution
# via pip, so that we don't override any conda resolved dependencies
session.install("-e", ".", "--no-deps")


@nox.session(python=CONDA_TEST_PYTHON_VERSIONS, venv_backend="mamba")
def conda_test(session):
"""Run test suite in a conda virtual environment.

Installs all test dependencies, then installs this package.
NOTE: Some of these libraries are not readily available on conda-forge
at this time and are thus installed using pip after the base install of
libraries from conda-forge.

We decided that it was more important to prove a base ability to install
using conda than to complicate things with adding a whole nother
set of constraints just for a conda install, so this install does not
attempt to constrain packages (i.e. in a constraints-x.x.txt file)
manually.
"""

standard_deps = (
UNIT_TEST_STANDARD_DEPENDENCIES
+ UNIT_TEST_DEPENDENCIES
+ UNIT_TEST_EXTERNAL_DEPENDENCIES
)

conda_forge_packages = [
"db-dtypes",
"google-api-core",
"google-auth",
"google-auth-oauthlib",
"google-cloud-bigquery",
"google-cloud-bigquery-storage",
"numpy",
"pandas",
"pyarrow",
"pydata-google-auth",
"tqdm",
"protobuf",
]

install_conda_unittest_dependencies(session, standard_deps, conda_forge_packages)

# Provide a list of all installed packages (both from conda forge and pip)
# for troubleshooting purposes.
session.run("mamba", "list")
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved

# Tests are limited to unit tests only, at this time.
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=pandas_gbq",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
os.path.join("tests", "unit"),
*session.posargs,
)
Loading