Skip to content

Commit

Permalink
Merge change from x/compliance for build
Browse files Browse the repository at this point in the history
  • Loading branch information
delneg committed Apr 11, 2024
1 parent e78367b commit 554aace
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-ci-multiplatform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build CI multiplatform
on:
push:
branches: [ feat/x-compliance, '**-release' ]
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: Build Deb
on:
push:
branches: [ feat/x-compliance, '**-release' ]
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
build-deb:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
SGX_MODE: HW
steps:
Expand Down Expand Up @@ -44,9 +45,9 @@ jobs:
target: build-deb
- name: Run .deb Package Image
run: |
docker run -e VERSION=${{ steps.get_version.outputs.version-without-v }} -v $GITHUB_WORKSPACE/build:/build deb_build
cp build/swisstronik_${{ steps.get_version.outputs.version-without-v }}_amd64.deb swisstronik_${{ steps.get_version.outputs.version-without-v }}_amd64.deb
docker run -e VERSION=${{ steps.vars.outputs.short_sha }} -v $GITHUB_WORKSPACE/build:/build deb_build
cp build/swisstronik_${{ steps.vars.outputs.short_sha }}_amd64.deb swisstronik_${{ steps.vars.outputs.short_sha }}_${{ env.BRANCH_NAME }}_amd64.deb
- uses: actions/upload-artifact@v3
with:
name: swisstronik_${{ steps.get_version.outputs.version-without-v }}_amd64.deb
path: swisstronik_${{ steps.get_version.outputs.version-without-v }}_amd64.deb
name: swisstronik_${{ steps.vars.outputs.short_sha }}_${{ env.BRANCH_NAME }}_amd64.deb
path: swisstronik_${{ steps.vars.outputs.short_sha }}_${{ env.BRANCH_NAME }}_amd64.deb
2 changes: 1 addition & 1 deletion docker/deb.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y > /dev/null 2>&1
RUN cargo install protobuf-codegen --version "2.8.1" -f

# Install golang
ADD https://go.dev/dl/go1.19.linux-amd64.tar.gz go.linux-amd64.tar.gz
ADD https://go.dev/dl/go1.22.1.linux-amd64.tar.gz go.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go.linux-amd64.tar.gz && rm go.linux-amd64.tar.gz
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest > /dev/null 2>&1
Expand Down
22 changes: 12 additions & 10 deletions go-sgxvm/internal/api/lib_nosgx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ package api
import "C"

import (
"net"
"github.com/SigmaGmbH/librustgo/types"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"math/rand"
"net"
)

// Value types
Expand All @@ -32,6 +33,13 @@ type cu8_ptr = *C.uint8_t
// Connector is our custom connector
type Connector = types.Connector

func CheckNodeStatus() error {
return nil
}
func RequestMasterKey(host string, port int, isDCAP bool) error {
return nil
}

// IsNodeInitialized checks if node was initialized and master key was sealed
func IsNodeInitialized() (bool, error) {
return false, nil
Expand All @@ -58,7 +66,9 @@ func RequestSeed(hostname string, port int) error {

// GetNodePublicKey handles request for node public key
func GetNodePublicKey() (*types.NodePublicKeyResponse, error) {
return nil, nil
key := make([]byte, 32)
rand.Read(key)
return &types.NodePublicKeyResponse{PublicKey: key}, nil
}

// Call handles incoming call to contract or transfer of value
Expand Down Expand Up @@ -89,11 +99,3 @@ func Create(
func StartAttestationServer(epidAddress, dcapAddress string) error {
return nil
}

func CheckNodeStatus() error {
return nil
}

func RequestMasterKey(host string, port int, isDCAP bool) error {
return nil
}
2 changes: 1 addition & 1 deletion sgxvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ define compile_unsigned_enclave
@echo "Compile into unsinged enclave"
@g++ $(CURDIR)/Enclave_t.o -o $(CURDIR)/enclave.unsigned.so -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L/opt/intel/sgxsdk/lib64 \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_dcap_tvl -l$(Service_Library_Name) -lsgx_tcrypto -lsgx_tprotected_fs -lpthread \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_dcap_tvl -l$(Service_Library_Name) -lsgx_tcrypto -lsgx_tprotected_fs -lsgx_pthread \
-L$(CURDIR)/sgx-artifacts/lib -lenclave -Wl,--end-group -Wl,--version-script=$(CURDIR)/Enclave.lds -Wl,-z,relro,-z,now,-z,noexecstack -Wl,-Bstatic -Wl,-Bsymbolic \
-Wl,--no-undefined -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--gc-sections -Wl,--defsym,__ImageBase=0
endef
Expand Down

0 comments on commit 554aace

Please sign in to comment.