Skip to content

Commit

Permalink
Merge pull request #54 from FederatedAI/develop-0.3.0
Browse files Browse the repository at this point in the history
Merge develop-0.3.0 to main for 0.3 release
  • Loading branch information
wfangchi authored May 22, 2023
2 parents fe5f391 + 1e7dbe8 commit 7a81a4c
Show file tree
Hide file tree
Showing 122 changed files with 7,134 additions and 2,510 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TAG=v0.2.0
TAG=v0.3.0

SERVER_NAME=federatedai/fedlcm-server
SERVER_IMG=${SERVER_NAME}:${TAG}
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/CodeQL.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]


jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
14 changes: 14 additions & 0 deletions .github/workflows/check-crlf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check CRLF

on: pull_request

jobs:
check-CRLF:
name: Check CRLF action
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main

- name: check-crlf
uses: erclu/check-crlf@v1
50 changes: 50 additions & 0 deletions .github/workflows/fedlcm-docker-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: FedLCM docker build and push

on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main

# Publish `v1.2.3` tags as releases.
tags:
- v*

jobs:
# no test is required
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@main

- name: Prepare the TAG
id: prepare-the-tag
run: |
# strip git ref prefix from version
TAG=""
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
if [ $VERSION = "main" ]; then
TAG="latest"
fi
echo "TAG=${TAG}"
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Build image
run: |
TAG=${{steps.prepare-the-tag.outputs.TAG}}
if [ ! -z "$TAG" ]; then
export TAG=$TAG
fi
make docker-build
- name: Log into DockerHub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push image
run: |
TAG=${{steps.prepare-the-tag.outputs.TAG}}
if [ ! -z "$TAG" ]; then
export TAG=$TAG
fi
make docker-push
25 changes: 25 additions & 0 deletions .github/workflows/fedlcm-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: FedLCM server unit test

on:
pull_request:
paths:
- ".github/workflows/fedlcm-unit-test.yaml"
- "server/**"
- “pkg/**”
jobs:
Unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/setup-go@v1
with:
go-version: 1.19
id: go

- name: Code
uses: actions/checkout@main

- name: Unit Test
run: |
make server-unittest
52 changes: 52 additions & 0 deletions .github/workflows/fml-manager-docker-build-and push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: FML-Manager docker build and push

on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main

# Publish `v1.2.3` tags as releases.
tags:
- v*

jobs:
# no test is required
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@main

- name: Prepare the TAG
id: prepare-the-tag
run: |
# strip git ref prefix from version
TAG=""
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
if [ $VERSION = "main" ]; then
TAG="latest"
fi
echo "TAG=${TAG}"
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Build image
run: |
TAG=${{steps.prepare-the-tag.outputs.TAG}}
if [ ! -z "$TAG" ]; then
export TAG=$TAG
fi
cd fml-manager
make docker-build
- name: Log into DockerHub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push image
run: |
TAG=${{steps.prepare-the-tag.outputs.TAG}}
if [ ! -z "$TAG" ]; then
export TAG=$TAG
fi
cd fml-manager
make docker-push
26 changes: 26 additions & 0 deletions .github/workflows/fml-manager-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: FML-Manager server unit test

on:
pull_request:
paths:
- ".github/workflows/fml-manager-unit-test.yaml"
- "fml-manager/server/**"

jobs:
Unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/setup-go@v1
with:
go-version: 1.19
id: go

- name: Code
uses: actions/checkout@main

- name: Unit Test
run: |
cd fml-manager
make server-unittest
52 changes: 52 additions & 0 deletions .github/workflows/site-portal-docker-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Site-Portal docker build and push

on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main

# Publish `v1.2.3` tags as releases.
tags:
- v*

jobs:
# no test is required
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@main

- name: Prepare the TAG
id: prepare-the-tag
run: |
# strip git ref prefix from version
TAG=""
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
if [ $VERSION = "main" ]; then
TAG="latest"
fi
echo "TAG=${TAG}"
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Build image
run: |
TAG=${{steps.prepare-the-tag.outputs.TAG}}
if [ ! -z "$TAG" ]; then
export TAG=$TAG
fi
cd site-portal
make docker-build
- name: Log into DockerHub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push image
run: |
TAG=${{steps.prepare-the-tag.outputs.TAG}}
if [ ! -z "$TAG" ]; then
export TAG=$TAG
fi
cd site-portal
make docker-push
26 changes: 26 additions & 0 deletions .github/workflows/site-portal-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Site-Portal server unit test

on:
pull_request:
paths:
- ".github/workflows/site-portal-unit-test.yaml"
- "site-portal/server/**"

jobs:
Unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/setup-go@v1
with:
go-version: 1.19
id: go

- name: Code
uses: actions/checkout@main

- name: Unit Test
run: |
cd site-portal
make server-unittest
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: all clean format swag swag-bin server-unittest server frontend run upgrade openfl-device-agent release

RELEASE_VERSION ?= ${shell git describe --tags}
TAG ?= v0.2.0
TAG ?= v0.3.0

SERVER_NAME ?= federatedai/fedlcm-server
SERVER_IMG ?= ${SERVER_NAME}:${TAG}
Expand Down Expand Up @@ -78,7 +78,7 @@ ifeq (, $(shell which swag))
SWAG_BIN_TMP_DIR=$$(mktemp -d) ;\
cd $$SWAG_BIN_TMP_DIR ;\
go mod init tmp ;\
go get -u github.com/swaggo/swag/cmd/swag ;\
go install github.com/swaggo/swag/cmd/swag@v1.8.7 ;\
rm -rf $$SWAG_BIN_TMP_DIR ;\
}
SWAG_BIN=$(GOBIN)/swag
Expand Down
1 change: 1 addition & 0 deletions cmd/device-agent/cli/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type envoyRegistrationConfig struct {
Labels valueobject.Labels `json:"labels"`
SkipCommonPythonFiles bool `json:"skip_common_python_files" yaml:"skipCommonPythonFiles"`
EnablePSP bool `json:"enable_psp" yaml:"enablePSP"`
LessPrivileged bool `json:"less_privileged" yaml:"lessPrivileged"`
RegistryConfig valueobject.KubeRegistryConfig `json:"registry_config" yaml:"registryConfig"`
}

Expand Down
Loading

0 comments on commit 7a81a4c

Please sign in to comment.