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

ci: Add build-test-publish-wheel workflow #114

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions .github/workflows/build-test-publish-wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build, test, and publish a PyPi wheel (to testpypi)

on:
push:
branches:
- main
- 'r**'
pull_request:

defaults:
run:
shell: bash -x -e -u -o pipefail {0}

jobs:
build-test-publish-wheel:
uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_build_test_publish_wheel.yml@ko3n1g/ci/build-wheel-public-infra
with:
dry-run: true
python-package: nemo_run
base_dir: src
environment: public
secrets:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
20 changes: 15 additions & 5 deletions src/nemo_run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
from nemo_run.run.experiment import Experiment
from nemo_run.run.plugin import ExperimentPlugin as Plugin

from nemo_run.package_info import (__contact_emails__, __contact_names__,
__description__, __download_url__, __keywords__,
__license__, __package_name__, __repository_url__,
__shortversion__, __version__)

__all__ = [
"autoconvert",
"cli",
Expand Down Expand Up @@ -68,9 +73,14 @@
"SlurmExecutor",
"SSHTunnel",
"Torchrun",
"__contact_emails__",
"__contact_names__",
"__description__",
"__download_url__",
"__keywords__",
"__license__",
"__package_name__",
"__repository_url__",
"__shortversion__",
"__version__"
]

try:
from nemo_run._version import __version__
except Exception:
__version__ = "0.0.1"
37 changes: 37 additions & 0 deletions src/nemo_run/package_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


MAJOR = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have hatch's vcs for versioning currently. See here - https://github.com/NVIDIA/NeMo-Run/blob/main/pyproject.toml#L118-L122.

Can you remove it if the versions are going to be manually maintained?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh that's sad, hatch seems like a cool tool. But I can't see how it fits into Nemo's release cycle. Because both pre-release and releases are rather github-workflow than some-other-cli-tool driven. I'd remove hatch for now

MINOR = 0
PATCH = 1
PRE_RELEASE = "rc0"
DEV = "dev1"

# Use the following formatting: (major, minor, patch, pre-release)
VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE, DEV)

__shortversion__ = ".".join(map(str, VERSION[:3]))
__version__ = __shortversion__ + VERSION[3] + "." + ".".join(VERSION[4:])

__package_name__ = "nemo_run"
__contact_names__ = "NVIDIA"
__contact_emails__ = "[email protected]"
__repository_url__ = "https://github.com/NVIDIA/NeMo-Run"
__download_url__ = "https://github.com/NVIDIA/NeMo-Run/releases"
__description__ = (
"NeMo-Run - A powerful tool designed to streamline the configuration, execution and management of Machine Learning experiments across various computing environments."
)
__license__ = "Apache2"
__keywords__ = "deep learning, machine learning, gpu, NLP, NeMo, nvidia, pytorch, torch, language, preprocessing, LLM, large language model"
Loading