Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
c4068d06
Commit
c4068d06
authored
Jan 14, 2024
by
Antoine Kaufmann
Committed by
Hejing Li
Feb 01, 2024
Browse files
images: add timesync image
This image contains chrony, ptp tools, and the modified cockroachdb
parent
e14f98ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
1 deletion
+76
-1
images/rules.mk
images/rules.mk
+8
-1
images/scripts/install-timesync.sh
images/scripts/install-timesync.sh
+68
-0
No files found.
images/rules.mk
View file @
c4068d06
...
@@ -31,9 +31,10 @@ NOPAXOS_IMAGE := $(d)output-nopaxos/nopaxos
...
@@ -31,9 +31,10 @@ NOPAXOS_IMAGE := $(d)output-nopaxos/nopaxos
MTCP_IMAGE
:=
$(d)
output-mtcp/mtcp
MTCP_IMAGE
:=
$(d)
output-mtcp/mtcp
TAS_IMAGE
:=
$(d)
output-tas/tas
TAS_IMAGE
:=
$(d)
output-tas/tas
HOMA_IMAGE
:=
$(d)
output-homa/homa
HOMA_IMAGE
:=
$(d)
output-homa/homa
TIMESYNC_IMAGE
:=
$(d)
output-timesync/timesync
COMPRESSED_IMAGES
?=
false
COMPRESSED_IMAGES
?=
false
IMAGES
:=
$(BASE_IMAGE)
$(NOPAXOS_IMAGE)
$(MEMCACHED_IMAGE)
$(HOMA_IMAGE)
IMAGES
:=
$(BASE_IMAGE)
$(NOPAXOS_IMAGE)
$(MEMCACHED_IMAGE)
$(HOMA_IMAGE)
$(TIMESYNC_IMAGE)
RAW_IMAGES
:=
$(
addsuffix
.raw,
$(IMAGES)
)
RAW_IMAGES
:=
$(
addsuffix
.raw,
$(IMAGES)
)
IMAGES_MIN
:=
$(BASE_IMAGE)
IMAGES_MIN
:=
$(BASE_IMAGE)
...
@@ -134,6 +135,12 @@ $(HOMA_IMAGE): $(packer) $(QEMU) $(BASE_IMAGE) \
...
@@ -134,6 +135,12 @@ $(HOMA_IMAGE): $(packer) $(QEMU) $(BASE_IMAGE) \
cd
$(img_dir)
&&
./packer-wrap.sh base homa extended-image.pkr.hcl
\
cd
$(img_dir)
&&
./packer-wrap.sh base homa extended-image.pkr.hcl
\
$(COMPRESSED_IMAGES)
$(COMPRESSED_IMAGES)
rm
-rf
$(img_dir)
/input-homa
rm
-rf
$(img_dir)
/input-homa
$(TIMESYNC_IMAGE)
:
$(packer) $(QEMU) $(BASE_IMAGE)
\
$(addprefix $(d)
,
extended-image.pkr.hcl scripts/install-timesync.sh
\
scripts/cleanup.sh)
rm
-rf
$(
dir
$@
)
cd
$(img_dir)
&&
./packer-wrap.sh base timesync extended-image.pkr.hcl
\
$(COMPRESSED_IMAGES)
touch
$@
touch
$@
$(packer)
:
$(packer)
:
...
...
images/scripts/install-timesync.sh
0 → 100644
View file @
c4068d06
#!/bin/bash -eux
ls
-l
/bin/sh
cd
/bin
rm
sh
ln
-s
bash sh
apt-get update
apt-get
-y
install
\
autoconf2.69
\
bison
\
build-essential
\
chrony
\
cmake
\
file
\
git
\
libncurses-dev
\
linuxptp
\
yarnpkg
wget
-O
/usr/local/bin/bazel
\
https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
GOVER
=
1.16.5
cd
/tmp
wget https://go.dev/dl/go
${
GOVER
}
.linux-amd64.tar.gz
tar
-C
/usr/local
-xzf
go
${
GOVER
}
.linux-amd64.tar.gz
rm
-f
go
${
GOVER
}
.linux-amd64.tar.gz
export
PATH
=
/usr/local/go/bin:
$PATH
export
GOPATH
=
/root/go
go
env
-w
GOPATH
=
$GOPATH
ln
-s
/usr/bin/yarnpkg /usr/bin/yarn
for
f
in
autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
do
cp
/usr/bin/
${
f
}
2.69 /usr/bin/
${
f
}
done
mkdir
-p
$GOPATH
/src/github.com/cockroachdb/
cd
$GOPATH
/src/github.com/cockroachdb/
git clone https://github.com/fabianlindfors/cockroach.git
cd
cockroach
sed
-i
-e
's/echo go install/echo $(GO_INSTALL)/g'
Makefile
make build
make
install
mkdir
-p
/root/cockroach/certs /root/cockroach/safedir
\
/root/cockroach/server-certs
cockroach cert create-ca
\
--certs-dir
=
/root/cockroach/certs
\
--ca-key
=
/root/cockroach/safedir/ca.key
for
i
in
`
seq
1 32
`
;
do
ip
=
10.0.0.
$i
cockroach cert create-node
$ip
\
--certs-dir
=
/root/cockroach/certs
\
--ca-key
=
/root/cockroach/safedir/ca.key
mv
/root/cockroach/certs/node.crt /root/cockroach/server-certs/
$ip
.crt
mv
/root/cockroach/certs/node.key /root/cockroach/server-certs/
$ip
.key
done
cockroach cert create-client
\
root
\
--certs-dir
=
/root/cockroach/certs
\
--ca-key
=
/root/cockroach/safedir/ca.key
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment