Skip to content

Commit

Permalink
Bump version to 1.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
angelonakos committed Feb 11, 2022
2 parents 8b58d19 + 3f30bdc commit e95f1e6
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 16 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
tags:
- '*'

name: Create Release

jobs:
perform-release:
name: Perform Release
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get Version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Create release
uses: actions/create-release@v1
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
body: |
This is Litani version ${{ env.VERSION }}.
## MacOS
On MacOS, install Litani using [Homebrew](https://brew.sh/) with
```sh
brew install aws/tap/litani
```
or upgrade (if it's already been installed) with:
```sh
brew upgrade litani
```
## Ubuntu
On Ubuntu, install Litani by downloading the *.deb package below for ubuntu-20.04 and install with
```sh
# Ubuntu 20.04:
$ apt install -y ./litani-${{ env.VERSION }}.deb
```
draft: false
prerelease: false
86 changes: 86 additions & 0 deletions .github/workflows/release-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
on:
release:
types: [created]

name: Upload additional release assets
jobs:
ubuntu-20_04-package:
name: Generate ubuntu-20.04 debian package
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Get Version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Setup directory for deb package
run: |
sudo apt-get install -y mandoc scdoc ninja-build
mkdir -p litani-${{ env.VERSION }}/{DEBIAN,usr/{bin,libexec/litani,share/{doc/litani,man/{man1,man5,man7}}}}
touch litani-${{ env.VERSION }}/DEBIAN/control
cat << EOF > litani-${{ env.VERSION }}/DEBIAN/control
Package: Litani
Version: ${{ env.VERSION }}
Architecture: amd64
Depends: ninja-build, gnuplot, graphviz, python3-jinja2
Maintainer: Kareem Khazem <karkhaz@amazon.co.uk>
Description: A program that provides platform-independent job control.
AWS Build Accumulator collects build jobs from multiple sources before executing
them concurrently. It provides platform-independent job control (timeouts,
return code control) and an output format that is easy to render into reports
(for example, using the built-in renderer). AWS Build Accumulator shines where
your project uses multiple different build systems or requires a unified
interface describing heterogeneous build jobs.
EOF
./doc/configure && ninja
mv bin lib templates litani litani-${{ env.VERSION }}/usr/libexec/litani/
mv doc/out/man/*.1 litani-${{ env.VERSION }}/usr/share/man/man1
mv doc/out/man/*.5 litani-${{ env.VERSION }}/usr/share/man/man5
mv doc/out/man/*.7 litani-${{ env.VERSION }}/usr/share/man/man7
mv doc/out/html/index.html litani-${{ env.VERSION }}/usr/share/doc/litani
ln -s /usr/libexec/litani/litani litani-${{ env.VERSION }}/usr/bin/
rm -r $(ls -A | grep -v litani-${{ env.VERSION }})
- name: Create .deb package
id: create_packages
run: |
sudo dpkg-deb --build --root-owner-group litani-${{ env.VERSION }}
deb_package_name="$(ls *.deb)"
echo "::set-output name=deb_package::$deb_package_name"
echo "::set-output name=deb_package_name::$deb_package_name"
- name: Install Litani using deb package
run: sudo apt-get update && sudo apt install -y ./litani-${{ env.VERSION }}.deb
- name: Test deb package
run: |
litani -h
man litani
litani init --project-name test
litani add-job --command '/usr/bin/true' --pipeline-name 'test' --ci-stage test
litani run-build
- name: Get release
id: get_release_info
uses: bruceadams/get-release@v1.2.3
- name: Upload release binary
uses: actions/upload-release-asset@v1.0.2
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.deb_package }}
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
asset_content_type: application/x-deb

homebrew-pr:
name: Homebrew Bump Formula PR
runs-on: macos-10.15
steps:
- name: Get release tag name
run: echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Configure git user name and email
uses: Homebrew/actions/git-user-config@master
with:
username: aws-build-accumulator-release-ci
- name: Create homebrew PR
run: |
brew update-reset
brew tap aws/tap
brew bump-formula-pr --tag "$RELEASE_TAG" --revision "$GITHUB_SHA" aws/tap/litani
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }}
18 changes: 17 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
CHANGELOG
`````````
Version 1.19.0 -- 2022-01-24
Version 1.20.0 -- 2022-02-11
----------------------------

This release introduces workflows for Litani that use GitHub Actions. It
additionally contains bug fixes.

- Workflow were added, which will create a Debian package as well as a PR
against the aws/homebrew-tap repository in order to update the brew formula.

Bug fixes:

- Prevent file extension from appearing twice in dot dependency diagram.
- Litani dump-run will dump the latest run, if no build is concurrently running.
- Update doc, examples for transform-jobs command.


Version 1.19.0 -- 2022-02--01
----------------------------

- Change man page extension from .roff to its chapter.
Expand Down
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,41 @@ a unified interface describing heterogeneous build jobs.
Hosted [here](https://awslabs.github.io/aws-build-accumulator/).


### Requirements
### Installation

* Python 3
To install with [Homebrew](https://brew.sh):

```bash
brew tap aws/tap
brew install litani
```

Documentation can also be accessed using `man`:

```bash
man litani
```

### Dependencies

If you are cloning the source code, you will need the following dependencies:

#### Required

* Python3
* [Ninja](https://ninja-build.org/)
* `apt-get install ninja-build`, `brew install ninja`
* [Jinja](https://jinja.palletsprojects.com/en/2.11.x/)
* `pip3 install jinja2`
* [Graphviz DOT](https://graphviz.org/)
* `apt-get install graphviz`, `brew install graphviz`

Recommended:
#### Recommended

* [Graphviz DOT](https://graphviz.org/)
* `apt-get install graphviz`, `brew install graphviz`
* [Gnuplot](http://www.gnuplot.info/) to generate graphs on the dashboard
* `apt-get install gnuplot`, `brew install gnuplot`

Optional:
#### Optional

* [Voluptuous](https://pypi.org/project/voluptuous/) to perform
sanity-checking on internal data structures
Expand Down
5 changes: 2 additions & 3 deletions doc/src/man/litani-dump-run.scdoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ This program prints the _run.json_ file for an in-progress Litani run to stdout.
The JSON file's schema is documented in *litani-run.json(5)*.

This program is intended to be used while an invocation of *litani-run-build(1)*
is running. After the *run-build* process has terminated, this program will not
work (though this may change in future versions). Instead, you can access the
_run.json_ file in the run's output directory.
is running. You can access the _run.json_ file in the run's output directory
both during and after termination of the *run-build* process.

This program may be run as a Litani job, and it may be run as a subprocess from
a command that is part of a Litani job. This allows commands to 'introspect' on
Expand Down
2 changes: 2 additions & 0 deletions doc/src/man/litani-transform-jobs.scdoc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ jobs = json.loads(proc.stdout.read())

print(json.dumps(jobs), file=proc.stdin)
proc.stdin.close()
proc.wait()
```


Expand Down Expand Up @@ -227,6 +228,7 @@ for job in jobs:

print(json.dumps(jobs), file=proc.stdin)
proc.stdin.close()
proc.wait()

# Now, add the new root job. (It's also fine to do this before or during the
# transformation, but remember to skip the new job when iterating!)
Expand Down
4 changes: 2 additions & 2 deletions doc/src/man/litani.scdoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ The following is a synopsis of Litani's subcommands:
you ran *litani init*.

*litani dump-run*
Print a JSON representation of the run so far to stdout while the
build is running.
Print a JSON representation of the run so far to stdout both while the
build is running as well as after it has completed.

*litani graph*
Print the dependency graph of the build in Graphviz format, ready to
Expand Down
1 change: 1 addition & 0 deletions examples/add-root-node/run-all.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

print(json.dumps(jobs), file=proc.stdin)
proc.stdin.close()
proc.wait()

# Now, add the new root job. (It's also fine to do this before or during the
# transformation, but remember to skip the new job when iterating!)
Expand Down
2 changes: 2 additions & 0 deletions examples/no-standalone-transform/run-all.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@

# ``````````````````````````````````````````````````````````````````````````````
# IMPORTANT! close "litani transform-jobs"'s stdin, otherwise it will block.
# This process should wait until all jobs have been transformed
#
proc.stdin.close()
proc.wait()

subprocess.run([litani, "run-build"], check=True)
4 changes: 2 additions & 2 deletions lib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def __init__(self, fyle, line_width=40, **style):
self.id = hash(fyle)

path = pathlib.Path(fyle)
_, ext = os.path.splitext(path.name)
name, ext = os.path.splitext(path.name)

self.style = style

wrapper = get_text_wrapper(line_width)
path_name = "\n".join(wrapper.wrap(path.name))
path_name = "\n".join(wrapper.wrap(name))
self.style["label"] = f"{path_name}{ext}"


Expand Down
2 changes: 1 addition & 1 deletion lib/litani.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ"
TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ"
VERSION_MAJOR = 1
VERSION_MINOR = 19
VERSION_MINOR = 20
VERSION_PATCH = 0
RC = False

Expand Down
16 changes: 15 additions & 1 deletion lib/run_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,21 @@ def _exit_error():


def _try_dump_run(cache_dir, pid, sleeper, check_run):
os.kill(pid, DUMP_SIGNAL)
try:
os.kill(pid, DUMP_SIGNAL)
except ProcessLookupError:
logging.debug("pid %s does not match to a running process", pid)
latest_run_file = cache_dir / lib.litani.RUN_FILE
try:
with open(latest_run_file) as handle:
latest_run = json.load(handle)
check_run(latest_run)
_exit_success(latest_run)
except (
FileNotFoundError, json.decoder.JSONDecodeError,
InconsistentRunError):
logging.warning("Could not find run.json inside the latest run")
_exit_error()
try:
with open(cache_dir / _DUMPED_RUN) as handle:
run = json.load(handle)
Expand Down

0 comments on commit e95f1e6

Please sign in to comment.