Skip to content

Commit

Permalink
Merge pull request #13 from fpco/lts-20
Browse files Browse the repository at this point in the history
Bump version, add Github actions
  • Loading branch information
psibi authored Nov 29, 2022
2 parents 6b919df + 676dab1 commit ac768eb
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 229 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

on:
pull_request:
push:
branches:
- master

jobs:
build:
name: CI
runs-on: ${{ matrix.os }}
env:
STACK_ROOT: ${{ github.workspace }}/.stack
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
stack-yaml: stack.yaml
resolver: lts-20.2
- os: ubuntu-latest
stack-yaml: stack.yaml
resolver: nightly
steps:
- name: Clone project
uses: actions/checkout@v2
with:
submodules: 'true'

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.stack
${{ github.workspace }}/.stack
key: ${{ runner.os }}-${{ matrix.resolver }}-haskell-${{ hashFiles('stack.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-haskell-
- name: Build and run tests
shell: bash
run: |
set -exuo pipefail
curl -sSL https://get.haskellstack.org/ | sh -s - -f
stack test --fast --no-terminal --stack-yaml=${{ matrix.stack-yaml }} --resolver=${{ matrix.resolver }}
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: pid1-${{ github.ref }}
body_path: ChangeLog.md
draft: false
prerelease: false
199 changes: 0 additions & 199 deletions .travis.yml

This file was deleted.

19 changes: 19 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 0.1.3.1

- Update to accomodate changes from latest process library. (`OpenExtHandle`).
- Improve documentation related to timeout.

## 0.1.3.0

- By default pid1 will first send the TERM signal to it's "immediate
child" process. In most scenarios that will be the only process
running but in some cases that will be the "main" process that could
have spawned it's own children. In this scenario it's prudent to
shutdown the "main" process first, since usually it has mechanisms in
place to shut down it's children. If we were to shutdown a child
process before "main" was shutdown it might try to restart it. This
is why, if the "main" process doesn't exit within `timeout` we will
proceed to send the TERM signal to all processes and wait **again**
for `timeout` until we finally send the KILL signal to all
processes. This is a **breaking change in 0.1.3.0**.

## 0.1.2.0

* Removes support for ',' separated list of environment variables
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## pid1
# pid1

[![Build Status](https://travis-ci.org/fpco/pid1.svg?branch=master)](https://travis-ci.org/fpco/pid1)
[![Build](https://github.com/fpco/pid1/actions/workflows/build.yml/badge.svg)](https://github.com/fpco/pid1/actions/workflows/build.yml)

Do signal handling and orphan reaping for Unix PID1 init processes.

Expand All @@ -20,7 +20,7 @@ Windows, I'd be interested in hearing about it.
For a discussion on why this is useful, see [this
repo](https://github.com/snoyberg/docker-testing#readme).

### Usage
## Usage

> pid1 [-e|--env ENV] [-u|--user USER] [-g|--group GROUP] [-w|--workdir DIR] [-t|--timeout TIMEOUT] COMMAND [ARG1 ARG2 ... ARGN]
Expand All @@ -32,7 +32,7 @@ Where:
* `-g`, `--group` `GROUP` - The group name the process will setgid before
executing COMMAND
* `-w`, `--workdir` `DIR` - chdir to `DIR` before executing COMMAND
* `-t`, `--timeout` `TIMEOUT` - timeout (in seconds) to wait for all child processes to exit
* `-t`, `--timeout` `TIMEOUT` - timeout (in seconds) to wait for all child processes to exit (Default is 5 seconds)

`WARNING`: by default pid1 will first send the TERM signal to it's "immediate child" process.
In most scenarios that will be the only process running but in some cases that will be the
Expand All @@ -59,3 +59,8 @@ are:
```
docker run --rm --entrypoint /usr/bin/env fpco/pid1 /sbin/pid1 ps
```

## Docker images

You can find various docker images [here](https://registry.hub.docker.com/r/fpco/pid1/tags). We usually target Ubuntu
LTS as the parent image.
2 changes: 1 addition & 1 deletion pid1.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pid1
version: 0.1.3.0
version: 0.1.3.1
synopsis: Do signal handling and orphan reaping for Unix PID1 init processes
description: Please see README.md or view Haddocks at <https://www.stackage.org/package/pid1>
homepage: https://github.com/fpco/pid1#readme
Expand Down
12 changes: 12 additions & 0 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages: []
snapshots:
- completed:
sha256: fc39d8afc97531d53d87b10abdef593bce503c0c1e46c2e9a84ebcbc78bf8470
size: 648432
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/2.yaml
original: lts-20.2
25 changes: 0 additions & 25 deletions static-base/Dockerfile

This file was deleted.

0 comments on commit ac768eb

Please sign in to comment.