Skip to content

Commit 998689d

Browse files
docs: fix Ubuntu 20.04 installation guide (#270)
1 parent ad61176 commit 998689d

File tree

1 file changed

+49
-28
lines changed

1 file changed

+49
-28
lines changed
Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,118 @@
11
# Install Certifier (Ubuntu 20.04)
22

3-
43
### Setup Environment variables
54

5+
```bash
66
cd ~/Projects
77
git clone https://github.com/ccc-certifier-framework/certifier-framework-for-confidential-computing.git
88

99
export CERTIFIER=~/Projects/certifier-framework-for-confidential-computing
1010
export EXAMPLE_DIR=$CERTIFIER/sample_app
11+
```
1112

1213
### Install Dependencies
13-
```
14-
sudo apt install libgtest-dev libgflags-dev
14+
15+
**Note**: The UUID library is required for compilation but was missing from the original documentation.
16+
17+
```bash
18+
sudo apt update
19+
sudo apt install libgtest-dev libgflags-dev uuid-dev
1520
```
1621

1722
We note that the versioning of `protobuf` and `golang` matters. One shall not use the distribution directly `apt`-ed from Ubuntu.
1823

1924
Install the latest protobuf from source by
20-
```
25+
```bash
2126
sudo apt install autoconf automake libtool curl make g++ unzip
2227
git clone https://github.com/protocolbuffers/protobuf.git
2328
cd protobuf
2429
git submodule update --init --recursive
2530
./autogen.sh && ./configure
26-
make -j$(nproc) && sudo make install
27-
sudo ldconfig # refresh shared library cache.
31+
make -j$(nproc) && sudo make install
32+
sudo ldconfig # refresh shared library cache.
2833
```
29-
the detailed installation procedure can be found https://github.com/protocolbuffers/protobuf/blob/main/src/README.md.
34+
The detailed installation procedure can be found https://github.com/protocolbuffers/protobuf/blob/main/src/README.md.
3035

3136
Install the latest `golang` by
32-
```
37+
```bash
3338
sudo apt install wget
3439
wget https://go.dev/dl/go1.18.4.linux-amd64.tar.gz
3540
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz
3641
export PATH=$PATH:/usr/local/go/bin && export PATH=$PATH:$(go env GOPATH)/bin
3742
rm go1.18.4.linux-amd64.tar.gz
3843
```
3944

40-
The protobuf compiler(protoc) for golang is installed by
45+
**Updated Go Protobuf Installation**: The `go get` commands are deprecated. Use `go install` instead:
46+
```bash
47+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
48+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
4149
```
42-
go get github.com/golang/protobuf/proto
43-
go get google.golang.org/protobuf/cmd/protoc-gen-go
50+
51+
**Alternative method** (if the above doesn't work, as referenced in the grpc.io quickstart):
52+
```bash
53+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
54+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
4455
```
4556

4657
Ensure OpenSSL library and OpenSSL headers are installed or install by
47-
```
48-
sudo apt install openssl
49-
sudo apt install libssl-dev
58+
```bash
59+
sudo apt install openssl libssl-dev
5060
```
5161
Current tests on Ubuntu are with OpenSSL 1.1.1f.
5262

5363
### Compile Certifier Library
64+
5465
The certifier library can be compiled by
55-
```
56-
cd $CERTIFIER/src
57-
make -f certifier.mak
66+
```bash
67+
cd $CERTIFIER/src
68+
make -f certifier.mak
5869

5970
cd $CERTIFIER/utilities
6071
make -f cert_utility.mak
6172
make -f policy_utilities.mak
6273
```
6374

64-
6575
### Build the Certifier Service
6676

6777
1. Compile the protobuf required by certifier service by
68-
```
69-
cd $CERTIFIER/certifier_service/certprotos
70-
protoc --go_opt=paths=source_relative --go_out=. --go_opt=Mcertifier.proto= ./certifier.proto
78+
```bash
79+
cd $CERTIFIER/certifier_service/certprotos
80+
protoc --go_opt=paths=source_relative --go_out=. --go_opt=Mcertifier.proto= ./certifier.proto
7181
```
7282

7383
2. Install the certifier as go library by
74-
```
75-
go install github.com/jlmucb/crypto@latest
84+
```bash
85+
go install github.com/jlmucb/crypto@latest
7686
# TODO: this is a workaround to an existing path issue
7787
mkdir -p $(go env GOPATH)/src/github.com/jlmucb/crypto/v2
7888
sudo cp -r $CERTIFIER $(go env GOPATH)/src/github.com/jlmucb/crypto/v2
7989
```
8090

8191
3. Build the simple server
82-
```
83-
cd $CERTIFIER/certifier_service
84-
go build simpleserver.go
92+
```bash
93+
cd $CERTIFIER/certifier_service
94+
go build simpleserver.go
8595
```
8696
If showing error of `go.mod not found`, run `go env -w GO111MODULE=off` before building.
8797

88-
8998
### Run `sample_app`
9099

91100
To run sample application, follow the README in sample_app or directly run
92-
```
101+
```bash
93102
cd $EXAMPLE_DIR
94103
chmod +x ./script
95104
./script
96105
```
97106

107+
## Troubleshooting
108+
109+
### Common Issues:
110+
111+
1. **UUID library missing**: If you get `fatal error: uuid/uuid.h: No such file or directory`, ensure you've installed `uuid-dev`:
112+
```bash
113+
sudo apt install uuid-dev
114+
```
115+
116+
2. **Go protobuf installation issues**: The original `go get` commands are deprecated. Use the updated `go install` commands provided above, or refer to the official gRPC Go quickstart guide at https://grpc.io/docs/languages/go/quickstart/
117+
118+
3. **Protobuf version conflicts**: Make sure to install protobuf from source rather than using the Ubuntu package to avoid version mismatches.

0 commit comments

Comments
 (0)