Skip to content

Commit

Permalink
build: Prepare for first release (#7)
Browse files Browse the repository at this point in the history
* build: Prepare for first release

Co-authored-by: francisco <franciscolopezsancho@gmail.com>
  • Loading branch information
patriknw and franciscolopezsancho authored Nov 28, 2022
1 parent b29cc8d commit a2f272e
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0

- name: Set up JDK 11
- name: Set up JDK 8
uses: coursier/setup-action@v1.3.0
with:
jvm: temurin:1.11.0
jvm: temurin:1.8.0

- name: Code style check and binary-compatibility check
run: |-
Expand Down Expand Up @@ -90,4 +90,4 @@ jobs:
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt test
sbt test
70 changes: 70 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish

on:
push:
branches:
- main
tags: ["*"]

permissions:
contents: read

jobs:
sbt:
name: sbt publish
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-diagnostics'
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0

- name: Set up JDK 8
uses: coursier/setup-action@v1.3.0
with:
jvm: adopt:1.8.0-275

- name: Publish
run: |-
cp .jvmopts-ci .jvmopts
sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

documentation:
name: Documentation
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-diagnostics'
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0

- name: Set up JDK 11
uses: coursier/setup-action@v1.3.0
with:
jvm: temurin:1.11.0

- name: Publish API and reference documentation
run: |-
eval "$(ssh-agent -s)"
echo $SCP_SECRET | base64 -d > /tmp/id_rsa
chmod 600 /tmp/id_rsa
ssh-add /tmp/id_rsa
cp .jvmopts-ci .jvmopts
sbt docs/publishRsync
env:
SCP_SECRET: ${{ secrets.SCP_SECRET }}
4 changes: 2 additions & 2 deletions LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Business Source License 1.1
Parameters

Licensor: Lightbend, Inc.
Licensed Work: Akka 2.8.x
Licensed Work: Akka Diagnostics 2.0.x
The Licensed Work is (c) 2022 Lightbend Inc.
Additional Use Grant:
If you develop an application using a version of Play Framework that
Expand All @@ -15,7 +15,7 @@ Additional Use Grant:
Connecting to a Play Framework websocket and/or Play Framework
request/response bodies for server and play-ws client.

Change Date: TBD ( 3 years after 2.8.0 release )
Change Date: TBD ( 3 years after 2.0.0 release )

Change License: Apache License, Version 2.0

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
Akka Diagnostics is a suite of useful components that complement Akka.

## Akka Thread Starvation Detector

The Akka Thread Starvation Detector is a diagnostic tool that monitors the dispatcher of an ActorSystem and will log a warning if the dispatcher becomes unresponsive.

The most common reason for an ActorSystem to become unresponsive is that blocking tasks are run on the dispatcher and other tasks cannot be executed in a timely fashion any more. This will lead to all kinds of problems because tasks (like handling an Actor’s mailbox or executing a Future callback) are usually expected to finish in very short time on a healthy ActorSystem. When thread starvation occurs, all threads of the dispatcher’s thread pool are blocking e.g. doing IO, delaying other work for indefinite periods of time. The symptoms of thread starvation are usually increased latency (despite low CPU usage), timeouts, or failing Akka Remote connections.
For questions please use the [discuss.akka.io](https://discuss.akka.io).

The documentation can be found [here](https://doc.akka.io/docs/akka-diagnostics/current/index.html)

The Starvation Detector will periodically schedule a simple task to measure the scheduling and execution time of the dispatcher. If a threshold is exceeded, a warning is logged with stack traces that show what threads of the dispatcher are busy with.
## Project status

Using the Starvation Detector
To use the Starvation Detector feature a dependency on the akka-diagnostics artifact must be added.
This library is ready to be used in production, APIs are stable, and the Lightbend subscription covers support for this project.

## License

sbt
"com.lightbend.akka" %% "akka-diagnostics" % "1.1.16"
Akka Diagnostics is licensed under the Business Source License 1.1, see LICENSE.
37 changes: 37 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Releasing

## How to release

Create a new issue from the [Release Train Issue Template](docs/release-train-issue-template.md):

```
$ sh ./scripts/create-release-issue.sh 0.x.y
```

### Releasing only updated docs

It is possible to release a revised documentation to the already existing release.

1. Create a new branch from a release tag. If a revised documentation is for the `v0.3` release, then the name of the new branch should be `docs/v0.3`.
1. Add and commit `version.sbt` file that pins the version to the one, that is being revised. Also set `isSnapshot` to `false` for the stable documentation links. For example:
```scala
ThisBuild / version := "0.6.1"
ThisBuild / isSnapshot := false
```
1. Make all of the required changes to the documentation.
1. Build documentation locally with:
```sh
sbt docs/previewSite
```
1. If the generated documentation looks good, send it to Gustav:
```sh
rm -r docs/target/site
sbt docs/publishRsync
```
1. Do not forget to push the new branch back to GitHub.

## Snapshots

If you want to test an improvement that is not yet released, you can use a
snapshot version: we release all commits to main to the snapshot repository
on [Sonatype](https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-diagnostics).
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import akka.AutomaticModuleName

GlobalScope / parallelExecution := false
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1)

Expand Down Expand Up @@ -65,6 +67,7 @@ lazy val root = (project in file("."))
lazy val `akka-diagnostics` = (project in file("akka-diagnostics"))
.settings(common)
.settings(libraryDependencies ++= Dependencies.akkaDiagnostics)
.settings(AutomaticModuleName.settings("akka.diagnostics"))

lazy val docs = (project in file("docs"))
.enablePlugins(AkkaParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, PublishRsyncPlugin)
Expand Down
6 changes: 4 additions & 2 deletions docs/src/main/paradox/starvation-detector.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ The Starvation Detector will periodically schedule a simple task to measure the
the dispatcher. If a threshold is exceeded, a warning is logged with stack traces that show what threads of the
dispatcher are busy with.

## Project Info

@@project-info{ projectId="akka-diagnostics" }

## Using the Starvation Detector

To use the Starvation Detector feature a dependency on the *akka-diagnostics* artifact must be added.

```
@@dependency [Maven,sbt,Gradle] {
group=com.lightbend.akka
artifact=akka-diagnostics_$scala.binary.version$
Expand All @@ -28,7 +31,6 @@ To use the Starvation Detector feature a dependency on the *akka-diagnostics* ar
This plugin depends on Akka $akka.version$ or later, and note that it is important that all `akka-*`
dependencies are in the same version, so it is recommended to depend on them explicitly to avoid problems
with transient dependencies causing an unlucky mix of versions.
```

When this dependency is included the Starvation Detector is automatically run when the *ActorSystem*
is started.
Expand Down
23 changes: 23 additions & 0 deletions project/AutomaticModuleName.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2016-2022 Lightbend Inc. <https://www.lightbend.com>
*/
package akka

import sbt.Keys._
import sbt.Def
import sbt._

/**
* Helper to set Automatic-Module-Name in projects.
*
* !! DO NOT BE TEMPTED INTO AUTOMATICALLY DERIVING THE NAMES FROM PROJECT NAMES !!
*
* The names carry a lot of implications and DO NOT have to always align 1:1 with the group ids or package names, though
* there should be of course a strong relationship between them.
*/
object AutomaticModuleName {
private val AutomaticModuleName = "Automatic-Module-Name"

def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] =
Seq(Compile / packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name))
}
13 changes: 12 additions & 1 deletion project/project-info.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,15 @@ project-info {
}
]
}
}
akka-diagnostics: ${project-info.shared-info} {
title: "Akka Diagnostics"
jpms-name: "akka.diagnostics"
levels: [
{
readiness: Incubating
since: "2022-11-28"
since-version: "2.0.0-M1"
}
]
}
}
10 changes: 10 additions & 0 deletions scripts/create-release-issue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

VERSION=$1
if [ -z $VERSION ]
then
echo specify the version name to be released, eg. 1.0.0
else
sed -e 's/\$VERSION\$/'$VERSION'/g' docs/release-train-issue-template.md > /tmp/release-$VERSION.md
echo Created $(gh issue create --title "Release $VERSION" --body-file /tmp/release-$VERSION.md --milestone $VERSION --web)
fi

0 comments on commit a2f272e

Please sign in to comment.