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(GH workflow): migrate periodic functional tests to GH actions #10751

Merged

Conversation

shruti2522
Copy link
Contributor

@shruti2522 shruti2522 commented Apr 25, 2024

Description of your changes:
Fixes #10745. I have added the workflow file and tried running it locally, but I guess there is some issue with the package versions in requirements.txt.

Error Log:

|   × Preparing metadata (pyproject.toml) did not run successfully.
|   │ exit code: 1
|   ╰─> [40 lines of output]
|       Traceback (most recent call last):
|         File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
|           main()
|         File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
|           json_out['return_val'] = hook(**hook_input['kwargs'])
|         File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
|           return hook(metadata_directory, config_settings)
|         File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel
|           self.run_setup()
|         File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
|           super(_BuildMetaLegacyBackend,
|         File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
|           exec(compile(code, __file__, 'exec'), locals())
|         File "setup.py", line 68, in <module>
|           main()
|         File "setup.py", line 54, in main
|           setuptools.setup(
|         File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
|           return distutils.core.setup(**attrs)
|         File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 109, in setup
|           _setup_distribution = dist = klass(attrs)
|         File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 459, in __init__
|           _Distribution.__init__(
|         File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 293, in __init__
|           self.finalize_options()
|         File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 837, in finalize_options
|           ep(self)
|         File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 858, in _finalize_setup_keywords
|           ep.load()(self, ep.name, value)
|         File "/tmp/pip-build-env-sd7akepb/normal/local/lib/python3.10/dist-packages/cffi/setuptools_ext.py", line 216, in cffi_modules
|           add_cffi_module(dist, cffi_module)
|         File "/tmp/pip-build-env-sd7akepb/normal/local/lib/python3.10/dist-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
|           execfile(build_file_name, mod_vars)
|         File "/tmp/pip-build-env-sd7akepb/normal/local/lib/python3.10/dist-packages/cffi/setuptools_ext.py", line 25, in execfile
|           exec(code, glob, glob)
|         File "src/google_crc32c_build.py", line 47, in <module>
|           FFIBUILDER = cffi.FFI()
|         File "/tmp/pip-build-env-sd7akepb/normal/local/lib/python3.10/dist-packages/cffi/api.py", line 54, in __init__
|           raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation." % (
|       Exception: Version mismatch: this is the 'cffi' package version 1.16.0, located in '/tmp/pip-build-env-sd7akepb/normal/local/lib/python3.10/dist-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/lib/python3/dist-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so'.  The two versions should be equal; check your installation.
|       [end of output]
|   
|   note: This error originates from a subprocess, and is likely not a problem with pip.
| error: metadata-generation-failed
| 
| × Encountered error while generating package metadata.
| ╰─> See above for output.
| 
| note: This is an issue with the package mentioned above, not pip.
| hint: See above for details.
[Periodic Functional Tests/run_tests]   ❌  Failure - Main Run Functional Tests
[Periodic Functional Tests/run_tests] exitcode '1': failure
[Periodic Functional Tests/run_tests] 🏁  Job failed
Error: Job 'run_tests' failed

Checklist:

CC @rimolive

Copy link

Hi @shruti2522. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: migrate periodic functional tests to GH actions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: migrate periodic functional tests to GH actions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: migrate periodic functional tests to GH actions

feat: migrate periodic functional tests to GH actions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: migrate periodic functional tests to GH actions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@shruti2522 shruti2522 changed the title feat: migrate periodic functional tests to GH actions feat(GH workflow): migrate periodic functional tests to GH actions Apr 25, 2024
Copy link
Member

@rimolive rimolive left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I added some comments in the workflow code, you're doing a good job!

setup_kind:
runs-on: ubuntu-latest
steps:
- name: Check if Docker is installed
Copy link
Member

Choose a reason for hiding this comment

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

This step can be removed. GH Actions always provide docker binary

else
echo "Docker is already installed."
fi
- name: Install KinD
Copy link
Member

Choose a reason for hiding this comment

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

GH actions have an extension to provision KinD. Check this example: https://github.com/kubeflow/pipelines/blob/master/.github/workflows/backend.yml#L36

curl -Lo kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
chmod +x kind
sudo mv kind /usr/local/bin
- name: Verify KinD installation
Copy link
Member

Choose a reason for hiding this comment

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

Remove that step. Previous step if using the GH Action extension already verify installation

- name: Run Functional Tests
run:
./test/kfp-functional-test/kfp-functional-test.sh
- name: Collect test results
Copy link
Member

Choose a reason for hiding this comment

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

Although the step is present in the workflow, it requires some changes in the bash script to generate the artifacts.

  • Path creation is done here
  • Artifact collection is done here

Basically, what you can do is redirect this execution to a path that you create previously.

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@shruti2522
Copy link
Contributor Author

I have updated the code. Please take a look, @rimolive.

Copy link
Member

@rimolive rimolive left a comment

Choose a reason for hiding this comment

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

Some last changes before we start testing

./test/kfp-functional-test/kfp-functional-test.sh > periodic_tests.txt
mkdir -p ./test/artifacts # Directory to store artifacts
cp periodic_tests.txt ./test/artifacts/

Copy link
Member

Choose a reason for hiding this comment

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

node_image: kindest/node:v1.29.2
- name: Run Functional Tests
run:
./test/kfp-functional-test/kfp-functional-test.sh > periodic_tests.txt
Copy link
Member

Choose a reason for hiding this comment

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

Let me suggest a different approach:

log_dir=$(mktemp -d)
./test/kfp-functional-test/kfp-functional-test.sh > $log_dir/periodic_tests.txt

Copy link
Member

Choose a reason for hiding this comment

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

Why mktemp? It creates a random path under /tmp for your temporary artifact collection task. That way, the last step only needs to get all the paths created by mktemp, compress in a tarball, and publish to a remote path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the changes you suggested and included the artifact collection, @rimolive.

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@google-oss-prow google-oss-prow bot added size/S and removed size/M labels Apr 26, 2024
@shruti2522 shruti2522 marked this pull request as ready for review April 26, 2024 18:01
@rimolive
Copy link
Member

/ok-to-test

uses: actions/upload-artifact@v4
with:
name: periodic-functional-artifacts
path: $log_dir
Copy link
Member

Choose a reason for hiding this comment

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

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
Copy link
Member

Choose a reason for hiding this comment

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

nit: upgrade to actions/checkout@v4

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@shruti2522
Copy link
Contributor Author

Done @rimolive

@rimolive
Copy link
Member

rimolive commented May 4, 2024

Don't forget this. #10751 (comment)

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@shruti2522
Copy link
Contributor Author

done with the changes @rimolive

@@ -19,11 +19,10 @@ jobs:
node_image: kindest/node:v1.29.2
- name: Run Functional Tests
run: |
log_dir=$(mktemp -d)
Copy link
Member

Choose a reason for hiding this comment

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

Please, add this line back and don't make any other changes. All we need is this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, might have done it by mistake. I will add it back

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@rimolive
Copy link
Member

rimolive commented May 5, 2024

/lgtm

cc @chensun

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chensun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit c4d7ec3 into kubeflow:master May 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate periodic functional tests to GH Actions
3 participants