Skip to content

Commit e95f1e6

Browse files
committed
Bump version to 1.20.0
2 parents 8b58d19 + 3f30bdc commit e95f1e6

File tree

12 files changed

+205
-16
lines changed

12 files changed

+205
-16
lines changed

.github/workflows/create-release.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
tags:
4+
- '*'
5+
6+
name: Create Release
7+
8+
jobs:
9+
perform-release:
10+
name: Perform Release
11+
runs-on: ubuntu-20.04
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }}
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
- name: Get Version
18+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
19+
- name: Create release
20+
uses: actions/create-release@v1
21+
with:
22+
tag_name: ${{ env.VERSION }}
23+
release_name: ${{ env.VERSION }}
24+
body: |
25+
This is Litani version ${{ env.VERSION }}.
26+
27+
## MacOS
28+
29+
On MacOS, install Litani using [Homebrew](https://brew.sh/) with
30+
31+
```sh
32+
brew install aws/tap/litani
33+
```
34+
35+
or upgrade (if it's already been installed) with:
36+
37+
```sh
38+
brew upgrade litani
39+
```
40+
41+
## Ubuntu
42+
43+
On Ubuntu, install Litani by downloading the *.deb package below for ubuntu-20.04 and install with
44+
45+
```sh
46+
# Ubuntu 20.04:
47+
$ apt install -y ./litani-${{ env.VERSION }}.deb
48+
```
49+
draft: false
50+
prerelease: false
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
name: Upload additional release assets
6+
jobs:
7+
ubuntu-20_04-package:
8+
name: Generate ubuntu-20.04 debian package
9+
runs-on: ubuntu-20.04
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Get Version
15+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
16+
- name: Setup directory for deb package
17+
run: |
18+
sudo apt-get install -y mandoc scdoc ninja-build
19+
mkdir -p litani-${{ env.VERSION }}/{DEBIAN,usr/{bin,libexec/litani,share/{doc/litani,man/{man1,man5,man7}}}}
20+
touch litani-${{ env.VERSION }}/DEBIAN/control
21+
cat << EOF > litani-${{ env.VERSION }}/DEBIAN/control
22+
Package: Litani
23+
Version: ${{ env.VERSION }}
24+
Architecture: amd64
25+
Depends: ninja-build, gnuplot, graphviz, python3-jinja2
26+
Maintainer: Kareem Khazem <[email protected]>
27+
Description: A program that provides platform-independent job control.
28+
AWS Build Accumulator collects build jobs from multiple sources before executing
29+
them concurrently. It provides platform-independent job control (timeouts,
30+
return code control) and an output format that is easy to render into reports
31+
(for example, using the built-in renderer). AWS Build Accumulator shines where
32+
your project uses multiple different build systems or requires a unified
33+
interface describing heterogeneous build jobs.
34+
EOF
35+
./doc/configure && ninja
36+
mv bin lib templates litani litani-${{ env.VERSION }}/usr/libexec/litani/
37+
mv doc/out/man/*.1 litani-${{ env.VERSION }}/usr/share/man/man1
38+
mv doc/out/man/*.5 litani-${{ env.VERSION }}/usr/share/man/man5
39+
mv doc/out/man/*.7 litani-${{ env.VERSION }}/usr/share/man/man7
40+
mv doc/out/html/index.html litani-${{ env.VERSION }}/usr/share/doc/litani
41+
ln -s /usr/libexec/litani/litani litani-${{ env.VERSION }}/usr/bin/
42+
rm -r $(ls -A | grep -v litani-${{ env.VERSION }})
43+
- name: Create .deb package
44+
id: create_packages
45+
run: |
46+
sudo dpkg-deb --build --root-owner-group litani-${{ env.VERSION }}
47+
deb_package_name="$(ls *.deb)"
48+
echo "::set-output name=deb_package::$deb_package_name"
49+
echo "::set-output name=deb_package_name::$deb_package_name"
50+
- name: Install Litani using deb package
51+
run: sudo apt-get update && sudo apt install -y ./litani-${{ env.VERSION }}.deb
52+
- name: Test deb package
53+
run: |
54+
litani -h
55+
man litani
56+
litani init --project-name test
57+
litani add-job --command '/usr/bin/true' --pipeline-name 'test' --ci-stage test
58+
litani run-build
59+
- name: Get release
60+
id: get_release_info
61+
uses: bruceadams/[email protected]
62+
- name: Upload release binary
63+
uses: actions/[email protected]
64+
with:
65+
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
66+
asset_path: ${{ steps.create_packages.outputs.deb_package }}
67+
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
68+
asset_content_type: application/x-deb
69+
70+
homebrew-pr:
71+
name: Homebrew Bump Formula PR
72+
runs-on: macos-10.15
73+
steps:
74+
- name: Get release tag name
75+
run: echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
76+
- name: Configure git user name and email
77+
uses: Homebrew/actions/git-user-config@master
78+
with:
79+
username: aws-build-accumulator-release-ci
80+
- name: Create homebrew PR
81+
run: |
82+
brew update-reset
83+
brew tap aws/tap
84+
brew bump-formula-pr --tag "$RELEASE_TAG" --revision "$GITHUB_SHA" aws/tap/litani
85+
env:
86+
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.RELEASE_CI_ACCESS_TOKEN }}

CHANGELOG

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
CHANGELOG
22
`````````
3-
Version 1.19.0 -- 2022-01-24
3+
Version 1.20.0 -- 2022-02-11
4+
----------------------------
5+
6+
This release introduces workflows for Litani that use GitHub Actions. It
7+
additionally contains bug fixes.
8+
9+
- Workflow were added, which will create a Debian package as well as a PR
10+
against the aws/homebrew-tap repository in order to update the brew formula.
11+
12+
Bug fixes:
13+
14+
- Prevent file extension from appearing twice in dot dependency diagram.
15+
- Litani dump-run will dump the latest run, if no build is concurrently running.
16+
- Update doc, examples for transform-jobs command.
17+
18+
19+
Version 1.19.0 -- 2022-02--01
420
----------------------------
521

622
- Change man page extension from .roff to its chapter.

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,41 @@ a unified interface describing heterogeneous build jobs.
1313
Hosted [here](https://awslabs.github.io/aws-build-accumulator/).
1414

1515

16-
### Requirements
16+
### Installation
1717

18-
* Python 3
18+
To install with [Homebrew](https://brew.sh):
19+
20+
```bash
21+
brew tap aws/tap
22+
brew install litani
23+
```
24+
25+
Documentation can also be accessed using `man`:
26+
27+
```bash
28+
man litani
29+
```
30+
31+
### Dependencies
32+
33+
If you are cloning the source code, you will need the following dependencies:
34+
35+
#### Required
36+
37+
* Python3
1938
* [Ninja](https://ninja-build.org/)
2039
* `apt-get install ninja-build`, `brew install ninja`
2140
* [Jinja](https://jinja.palletsprojects.com/en/2.11.x/)
2241
* `pip3 install jinja2`
23-
* [Graphviz DOT](https://graphviz.org/)
24-
* `apt-get install graphviz`, `brew install graphviz`
2542

26-
Recommended:
43+
#### Recommended
2744

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

31-
Optional:
50+
#### Optional
3251

3352
* [Voluptuous](https://pypi.org/project/voluptuous/) to perform
3453
sanity-checking on internal data structures

doc/src/man/litani-dump-run.scdoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ This program prints the _run.json_ file for an in-progress Litani run to stdout.
3131
The JSON file's schema is documented in *litani-run.json(5)*.
3232

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

3837
This program may be run as a Litani job, and it may be run as a subprocess from
3938
a command that is part of a Litani job. This allows commands to 'introspect' on

doc/src/man/litani-transform-jobs.scdoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ jobs = json.loads(proc.stdout.read())
169169

170170
print(json.dumps(jobs), file=proc.stdin)
171171
proc.stdin.close()
172+
proc.wait()
172173
```
173174

174175

@@ -227,6 +228,7 @@ for job in jobs:
227228

228229
print(json.dumps(jobs), file=proc.stdin)
229230
proc.stdin.close()
231+
proc.wait()
230232

231233
# Now, add the new root job. (It's also fine to do this before or during the
232234
# transformation, but remember to skip the new job when iterating!)

doc/src/man/litani.scdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ The following is a synopsis of Litani's subcommands:
7373
you ran *litani init*.
7474

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

7979
*litani graph*
8080
Print the dependency graph of the build in Graphviz format, ready to

examples/add-root-node/run-all.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
print(json.dumps(jobs), file=proc.stdin)
5757
proc.stdin.close()
58+
proc.wait()
5859

5960
# Now, add the new root job. (It's also fine to do this before or during the
6061
# transformation, but remember to skip the new job when iterating!)

examples/no-standalone-transform/run-all.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252

5353
# ``````````````````````````````````````````````````````````````````````````````
5454
# IMPORTANT! close "litani transform-jobs"'s stdin, otherwise it will block.
55+
# This process should wait until all jobs have been transformed
5556
#
5657
proc.stdin.close()
58+
proc.wait()
5759

5860
subprocess.run([litani, "run-build"], check=True)

lib/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ def __init__(self, fyle, line_width=40, **style):
5656
self.id = hash(fyle)
5757

5858
path = pathlib.Path(fyle)
59-
_, ext = os.path.splitext(path.name)
59+
name, ext = os.path.splitext(path.name)
6060

6161
self.style = style
6262

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

6767

lib/litani.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ"
3434
TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ"
3535
VERSION_MAJOR = 1
36-
VERSION_MINOR = 19
36+
VERSION_MINOR = 20
3737
VERSION_PATCH = 0
3838
RC = False
3939

lib/run_printer.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,21 @@ def _exit_error():
123123

124124

125125
def _try_dump_run(cache_dir, pid, sleeper, check_run):
126-
os.kill(pid, DUMP_SIGNAL)
126+
try:
127+
os.kill(pid, DUMP_SIGNAL)
128+
except ProcessLookupError:
129+
logging.debug("pid %s does not match to a running process", pid)
130+
latest_run_file = cache_dir / lib.litani.RUN_FILE
131+
try:
132+
with open(latest_run_file) as handle:
133+
latest_run = json.load(handle)
134+
check_run(latest_run)
135+
_exit_success(latest_run)
136+
except (
137+
FileNotFoundError, json.decoder.JSONDecodeError,
138+
InconsistentRunError):
139+
logging.warning("Could not find run.json inside the latest run")
140+
_exit_error()
127141
try:
128142
with open(cache_dir / _DUMPED_RUN) as handle:
129143
run = json.load(handle)

0 commit comments

Comments
 (0)