Skip to content

Commit

Permalink
Merge branch 'master' into pfcp-prometheus-export-ue-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
pudelkoM committed Jan 18, 2022
2 parents 29ff905 + 1160e55 commit 825dd0d
Show file tree
Hide file tree
Showing 30 changed files with 626 additions and 336 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ jobs:
run: |
make pb
- name: Build the Docker image
- name: Build the BESS-UPF Docker image
run: |
make docker-build
DOCKER_TARGETS=bess make docker-build
- name: Build the PFCP Agent Docker image
run: |
DOCKER_TARGETS=pfcpiface make docker-build
# Format the code
- name: Clang Format
Expand All @@ -48,9 +52,14 @@ jobs:
git --no-pager diff
# Build again and commit
- name: Build the Docker image (after format)
- name: Build the BESS-UPF Docker image (after format)
run: |
make docker-build
DOCKER_TARGETS=bess make docker-build
- name: Build the PFCP Agent Docker image (after format)
run: |
DOCKER_TARGETS=pfcpiface make docker-build
- name: Update PR with changes
uses: gr2m/create-or-update-pull-request-action@v1.x
env:
Expand All @@ -61,11 +70,15 @@ jobs:
branch: ${{ github.event.pull_request.head.ref }}
author: "Github Actions <actions@github>"
commit-message: "Actions: Updated with changes from CI"
- uses: docker/login-action@v1.12.0
- id: docker-login
# Secrets from the main repo are not used if PR comes from fork. We skip pushing Docker image then.
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
uses: docker/login-action@v1.12.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Push Docker image
if: steps.docker-login.conclusion == 'success'
run: |
make docker-push
21 changes: 21 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022-present Open Networking Foundation
name: E2E integration tests

on:
push:
branches:
- master
pull_request:

jobs:
test-integration-up4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/setup-go@v2
with:
go-version: '1.13'
- name: Run integration tests for PFCP Agent & UP4
run: |
make test-up4-integration
14 changes: 14 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: upf-epc
Upstream-Contact: OMEC Developers <omec-dev@opennetworking.org>
Source: https://github.com/omec-project/upf-epc

Files: pfcpiface/**/*.pb.go
Copyright: 2016-2017, Nefeli Networks, Inc.
Copyright: 2017, The Regents of the University of California.
License: BSD-3-Clause

Files: docs/pipeline.txt ptf/docs/test-run.svg ptf/docs/upf-access.svg
Copyright: 2019-present Intel Corporation
Copyright: 2021-present Open Networking Foundation
License: Apache-2.0
42 changes: 24 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@
# Copyright (c) 2019 Intel Corporation

# Multi-stage Dockerfile

# Stage bess-deps: fetch BESS dependencies
FROM ghcr.io/omec-project/upf-epc/bess_build AS bess-deps
# BESS pre-reqs
WORKDIR /bess
ARG BESS_COMMIT=dpdk-2011-focal
RUN curl -L https://github.com/NetSys/bess/tarball/${BESS_COMMIT} | \
tar xz -C . --strip-components=1
COPY patches/bess patches
RUN cat patches/* | patch -p1
RUN cp -a protobuf /protobuf

# Stage bess-build: builds bess with its dependencies
FROM ghcr.io/omec-project/upf-epc/bess_build AS bess-build
FROM bess-deps AS bess-build
ARG CPU=native
RUN apt-get update && \
apt-get -y install --no-install-recommends \
Expand All @@ -25,17 +37,11 @@ RUN curl -L https://github.com/libbpf/libbpf/tarball/${LIBBPF_VER} | \
make install && \
ldconfig

# BESS pre-reqs
WORKDIR /bess
ARG BESS_COMMIT=dpdk-2011-focal
RUN curl -L https://github.com/NetSys/bess/tarball/${BESS_COMMIT} | \
tar xz -C . --strip-components=1

# Patch BESS, patch and build DPDK
COPY patches/dpdk/* deps/
COPY patches/bess patches
RUN cat patches/* | patch -p1 && \
./build.py dpdk
RUN ./build.py dpdk

# Plugins
RUN mkdir -p plugins
Expand All @@ -58,8 +64,7 @@ RUN ./build_bess.sh && \
cp core/modules/*.so /bin/modules && \
mkdir -p /opt/bess && \
cp -r bessctl pybess /opt/bess && \
cp -r core/pb /pb && \
cp -a protobuf /protobuf
cp -r core/pb /pb

# Stage bess: creates the runtime image of BESS
FROM python:3.9.9-slim AS bess
Expand Down Expand Up @@ -96,14 +101,14 @@ ENTRYPOINT ["bessd", "-f"]
FROM golang AS protoc-gen
RUN go get github.com/golang/protobuf/protoc-gen-go

FROM bess-build AS go-pb
FROM bess-deps AS go-pb
COPY --from=protoc-gen /go/bin/protoc-gen-go /bin
RUN mkdir /bess_pb && \
protoc -I /usr/include -I /protobuf/ \
/protobuf/*.proto /protobuf/ports/*.proto \
--go_opt=paths=source_relative --go_out=plugins=grpc:/bess_pb

FROM bess-build AS py-pb
FROM bess-deps AS py-pb
RUN pip install grpcio-tools==1.26
RUN mkdir /bess_pb && \
python -m grpc_tools.protoc -I /usr/include -I /protobuf/ \
Expand All @@ -114,12 +119,13 @@ RUN mkdir /bess_pb && \
FROM golang AS pfcpiface-build
WORKDIR /pfcpiface

COPY pfcpiface/go.mod ./
COPY pfcpiface/go.sum ./
COPY go.mod /pfcpiface/go.mod
COPY go.sum /pfcpiface/go.sum

RUN go mod download

COPY pfcpiface .
RUN CGO_ENABLED=0 go build -o /bin/pfcpiface
COPY . /pfcpiface
RUN CGO_ENABLED=0 go build -o /bin/pfcpiface ./pfcpiface

# Stage pfcpiface: runtime image of pfcpiface toward SMF/SPGW-C
FROM alpine AS pfcpiface
Expand All @@ -130,12 +136,12 @@ ENTRYPOINT [ "/bin/pfcpiface" ]

# Stage pb: dummy stage for collecting protobufs
FROM scratch AS pb
COPY --from=bess-build /protobuf /protobuf
COPY --from=bess-deps /bess/protobuf /protobuf
COPY --from=go-pb /bess_pb /bess_pb

# Stage ptf-pb: dummy stage for collecting python protobufs
FROM scratch AS ptf-pb
COPY --from=bess-build /protobuf /protobuf
COPY --from=bess-deps /bess/protobuf /protobuf
COPY --from=py-pb /bess_pb /bess_pb

# Stage binaries: dummy stage for collecting artifacts
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
SPDX-License-Identifier: Apache-2.0
Copyright(c) 2019 Intel Corporation
Copyright 2019 Intel Corporation
-->

# UPF-EPC - Installation Instructions
Expand Down
28 changes: 2 additions & 26 deletions LICENSE → LICENSES/Apache-2.0.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -173,29 +174,4 @@
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
END OF TERMS AND CONDITIONS
25 changes: 25 additions & 0 deletions LICENSES/BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the names of the copyright holders nor the names of their
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ DOCKER_LABEL_BUILD_DATE ?= $(shell date -u "+%Y-%m-%dT%H:%M:%SZ")

DOCKER_TARGETS ?= bess pfcpiface

# Golang grpc/protobuf generation
BESS_PB_DIR ?= pfcpiface
PTF_PB_DIR ?= ptf/lib

# https://docs.docker.com/engine/reference/commandline/build/#specifying-target-build-stage---target
docker-build:
for target in $(DOCKER_TARGETS); do \
Expand Down Expand Up @@ -60,9 +64,11 @@ output:
.;
rm -rf output && mkdir output && tar -xf output.tar -C output && rm -f output.tar

# Golang grpc/protobuf generation
BESS_PB_DIR ?= pfcpiface
PTF_PB_DIR ?= ptf/lib
test-up4-integration:
docker-compose -f test/integration/infra/docker-compose.yml rm -fsv
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker-compose -f test/integration/infra/docker-compose.yml up --build -d
go test -count=1 ./test/integration/...
docker-compose -f test/integration/infra/docker-compose.yml rm -fsv

pb:
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker build $(DOCKER_PULL) $(DOCKER_BUILD_ARGS) \
Expand All @@ -85,4 +91,4 @@ fmt:
golint:
@docker run --rm -v $(CURDIR):/app -w /app/pfcpiface golangci/golangci-lint:latest golangci-lint run -v --config /app/.golangci.yml

.PHONY: docker-build docker-push output pb fmt golint
.PHONY: docker-build docker-push output pb fmt golint test-integration
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
SPDX-License-Identifier: Apache-2.0
Copyright(c) 2019 Intel Corporation
Copyright 2019 Intel Corporation
-->

# upf-epc
Expand Down
37 changes: 6 additions & 31 deletions core/modules/qos.cc
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
// Copyright (c) 2014-2016, The Regents of the University of California.
// Copyright (c) 2016-2017, Nefeli Networks, Inc.
// Copyright (c) 2021 Intel Corporation
// All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the names of the copyright holders nor the names of their
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

/*
* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2014-2016, The Regents of the University of California.
* Copyright 2016-2017, Nefeli Networks, Inc.
* Copyright 2021-present Intel Corporation
*/
#include "qos.h"
#include "utils/endian.h"
#include "utils/format.h"
Expand Down
37 changes: 6 additions & 31 deletions core/modules/qos.h
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
// Copyright (c) 2014-2016, The Regents of the University of California.
// Copyright (c) 2016-2017, Nefeli Networks, Inc.
// Copyright (c) 2021 Intel Corporation
// All rights reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the names of the copyright holders nor the names of their
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

/*
* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2014-2016, The Regents of the University of California.
* Copyright 2016-2017, Nefeli Networks, Inc.
* Copyright 2021-present Intel Corporation
*/
#ifndef BESS_MODULES_QOS_H_
#define BESS_MODULES_QOS_H_

Expand Down
Loading

0 comments on commit 825dd0d

Please sign in to comment.