Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
niklastheman committed Jun 19, 2024
2 parents 7f7124c + 36edfd3 commit fa5c739
Show file tree
Hide file tree
Showing 60 changed files with 1,651 additions and 308 deletions.
14 changes: 2 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
ARG BASE_IMG
FROM $BASE_IMG
FROM python:3.10-slim

# Non-root user with sudo access
ARG USERNAME=default
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Versioning
ARG DOCKER_VERSION=19.03.9
ARG COMPOSE_VERSION=1.29.2

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -27,13 +23,7 @@ RUN apt-get --allow-releaseinfo-change update \
curl \
git \
vim \
#
# Install docker binaries
&& curl -L https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | tar xvz docker/docker \
&& cp docker/docker /usr/local/bin \
&& rm -R docker \
&& curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose \
ssh \
#
# Create a non-root user to use if preferred
&& groupadd --gid $USER_GID $USERNAME \
Expand Down
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
commit-message:
prefix: "deps"
labels:
- "dependencies"
reviewers:
- "Wrede"
- "stefanhellander"
# To ignore a dependency, uncomment the next two lines and replace "example-package" with the name of the dependency
#ignore:
# - dependency-name: "example-package"
# versions: ["< 1.0.0"]
14 changes: 14 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Label pull requests based on file paths, titles, or branch names
docs:
- changed-files:
- any-glob-to-any-file: ['docs/**','**/*.md']

github:
- changed-files:
- any-glob-to-any-file: ['.github/**']

feature:
- head-branch: ['^feature', 'feature']

fix:
- head-branch: ['^bug', 'bug', '^fix', 'fix']
37 changes: 37 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name-template: ' Release v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
labels:
- 'feature'
- 'enhancement'
- title: 'Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: 'Other'
label:
- 'chore'
- 'refactor'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
exclude-labels:
- 'dependencies'
- 'docs'
- 'github'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## What’s Changed
$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/branch-name-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master

env:
BRANCH_REGEX: '^((feature|hotfix|bugfix|bug|docs|refactor)\/.+)|(release\/v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$'
BRANCH_REGEX: '^((feature|github|dependabot|hotfix|bugfix|fix|bug|docs|refactor)\/.+)|(release\/v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$'

jobs:
branch-name-check:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: "integration tests"

on:
on:
push:
paths-ignore:
- 'docs/**'
- '.github/**'
branches:
- master
- develop
- 'release/**'
- master
- develop
- "release/**"
pull_request:
paths-ignore:
- 'docs/**'
- '.github/**'
branches:
- '**'
- "**"

jobs:
integration-tests:
Expand All @@ -17,7 +23,7 @@ jobs:
to_test:
- "mnist-keras numpyhelper"
- "mnist-pytorch numpyhelper"
python_version: ["3.8","3.9","3.10", "3.11"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os:
- ubuntu-22.04
runs-on: ${{ matrix.os }}
Expand All @@ -28,7 +34,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}

- name: run ${{ matrix.to_test }}
run: .ci/tests/examples/run.sh ${{ matrix.to_test }}

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Pull Request Labeler"
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5

54 changes: 54 additions & 0 deletions .github/workflows/pr_size_labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "PR Size Labeler"

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get PR Size
id: get_pr_size
run: |
CHANGED_FILES=$(jq '.pull_request.changed_files' $GITHUB_EVENT_PATH)
ADDITIONS=$(jq '.pull_request.additions' $GITHUB_EVENT_PATH)
DELETIONS=$(jq '.pull_request.deletions' $GITHUB_EVENT_PATH)
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
echo "ADDITIONS=$ADDITIONS" >> $GITHUB_ENV
echo "DELETIONS=$DELETIONS" >> $GITHUB_ENV
# OBS that we are cuurently not on a stable version, thus major is disabled for now
- name: Apply Labels Based on Size
if: ${{ github.event.pull_request.changed_files != '' }}
run: |
PATCH_THRESHOLD=10
MINOR_THRESHOLD=500
MAJOR_THRESHOLD=1000
TOTAL_CHANGES=$(($ADDITIONS + $DELETIONS))
echo "Total changes: $TOTAL_CHANGES"
if [ "$TOTAL_CHANGES" -le "$PATCH_THRESHOLD" ]; then
LABEL="patch"
elif [ "$TOTAL_CHANGES" -le "$MINOR_THRESHOLD" ]; then
LABEL="minor"
else
LABEL="minor"
fi
echo "Applying label: $LABEL"
curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
-d "{\"labels\":[\"$LABEL\"]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ADDITIONS: ${{ env.ADDITIONS }}
DELETIONS: ${{ env.DELETIONS }}
41 changes: 41 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ services:
"/bin/grpc_health_probe",
"-addr=localhost:12080"
]
interval: 2s
interval: 20s
timeout: 10s
retries: 5
depends_on:
Expand Down
19 changes: 5 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author = "Scaleout Systems AB"

# The full version, including alpha/beta/rc tags
release = "0.9.5"
release = "0.11.0"

# Add any Sphinx extension module names here, as strings
extensions = [
Expand All @@ -24,7 +24,7 @@
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx_rtd_theme",
"sphinx_code_tabs"
"sphinx_code_tabs",
]

# The master toctree document.
Expand Down Expand Up @@ -71,15 +71,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -89,24 +86,18 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "fedn.tex", "FEDn Documentation",
"Scaleout Systems AB", "manual"),
(master_doc, "fedn.tex", "FEDn Documentation", "Scaleout Systems AB", "manual"),
]

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, "fedn", "FEDn Documentation",
[author], 1)
]
man_pages = [(master_doc, "fedn", "FEDn Documentation", [author], 1)]

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, "fedn", "FEDn Documentation",
author, "fedn", "One line description of project.",
"Miscellaneous"),
(master_doc, "fedn", "FEDn Documentation", author, "fedn", "One line description of project.", "Miscellaneous"),
]

# Bibliographic Dublin Core info.
Expand Down
10 changes: 5 additions & 5 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ see the section about model marshaling:
Q: Can I start a client listening only to training requests or only on validation requests?:
--------------------------------------------------------------------------------------------

Yes! You can toggle which message streams a client subscibes to when starting the client. For example, to start a pure validation client:
Yes! You can toggle which message streams a client subscribes to when starting the client. For example, to start a pure validation client:

.. code-block:: bash
Expand All @@ -62,12 +62,12 @@ Yes! You can toggle which message streams a client subscibes to when starting th
Q: How do you approach the question of output privacy?
----------------------------------------------------------------------------------

We take security in (federated) machine learning seriously. Federated learning is a foundational technology that impoves input privacy
We take security in (federated) machine learning seriously. Federated learning is a foundational technology that improves input privacy
in machine learning by allowing datasets to stay local and private, and not copied to a server. FEDn is designed to provide an industry grade
implementation of the core communication and aggregration layers of federated learning, as well as configurable modules for traceability, logging
implementation of the core communication and aggregation layers of federated learning, as well as configurable modules for traceability, logging
etc, to allow the developer balance between privacy and auditability. With `FEDn Studio <https://scaleoutsystems.com/framework>`__ we add
functionality for user authentication, authorization, and federated client identity management. As such, The FEDn Framework provides
a comprehensive software suite for implemeting secure federated learning following industry best-practices.
a comprehensive software suite for implementing secure federated learning following industry best-practices.

Going beyond input privacy, there are several additional considerations relating to output privacy and potential attacks on (federated) machine learning systems.
For an introduction to the topic, see this blog post:
Expand All @@ -85,4 +85,4 @@ with the Scaleout team.
- `LEAKPRO: Leakage Profiling and Risk Oversight for Machine Learning Models <https://www.vinnova.se/en/p/leakpro-leakage-profiling-and-risk-oversight-for-machine-learning-models/>`__
- `Validating a System Development Kit for edge federated learning <https://www.vinnova.se/en/p/validating-a-system-development-kit-for-edge-federated-learning/>`__
- `Trusted Execution Environments for Federated Learning: <https://www.vinnova.se/en/p/trusted-execution-environments-for-federated-learning/>`__
- `Robust IoT Security: Intrusion Detection Leveraging Contributions from Multiple Systems <https://www.vinnova.se/en/p/robust-iot-security-intrusion-detection-leveraging-contributions-from-multiple-systems/>`__
- `Robust IoT Security: Intrusion Detection Leveraging Contributions from Multiple Systems <https://www.vinnova.se/en/p/robust-iot-security-intrusion-detection-leveraging-contributions-from-multiple-systems/>`__
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ For example, to split the data in 10 parts and start a client using the 8th part
$env:FEDN_PACKAGE_EXTRACT_DIR="package"
$env:FEDN_NUM_DATA_SPLITS=10
$env:FEDN_DATA_PATH="./data/clients/8/mnist.pt"
fedn run client -in client.yaml --secure=True --force-ssl
fedn client start -in client.yaml --secure=True --force-ssl


Start a training session
Expand Down
Loading

0 comments on commit fa5c739

Please sign in to comment.