23 Commits

Author SHA1 Message Date
68c334307c Merge pull request #34 from gianarb/bump/20210111
Bump tink stack 2021 01 11
2021-01-11 17:50:19 +05:30
be40a7b371 Bump tink stack 2021 01 11
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-01-11 12:24:26 +01:00
b504810679 provisioner setup changes to enable NAT for workers (#33)
## Description

Provisioner NAT setup for workers 

## Why is this needed

internet access on workers 
https://github.com/tinkerbell/sandbox/issues/31 


Fixes: #

## How Has This Been Tested?

- workflow executed successfully.
- ping from workers works correctly.

PR in reference with https://github.com/tinkerbell/tink/pull/410
2021-01-07 13:43:24 +00:00
7acaae68b4 provisioner setup changes to enable NAT for workers
provisioner setup changes to enable NAT for workers

Signed-off-by: cbkhare <Chitrabasukhare89@gmail.com>
2021-01-07 14:49:10 +05:30
0cb5e79447 Making statement on breaking changes clearer (#32)
## Description

Documentation

## Why is this needed

This statement is confusing, I needed to log into the community slack to get clarification.

Fixes: #

## How Has This Been Tested?
This is a documentation change and thus will not impact any software in this project.

## How are existing users impacted? What migration steps/scripts do we need?
They are not, newer users may find this a little easier to digest.


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-01-04 23:06:31 +00:00
64cc641150 Making statement on breaking changes clearer
Signed-off-by: jgavinray <jgavinray@linux.com>
2021-01-04 12:07:15 -08:00
3a5445e583 Merge pull request #29 from qmfrederik/fixes/windows-onboarding
For Unix-style line endings for scripts, add .env to .gitignore
2020-12-10 15:10:45 +01:00
2499b89fe6 Merge pull request #30 from tinkerbell/fix/cleanup-not-required-sql-init
Cleanup not required cleanup sql script
2020-12-10 15:08:51 +01:00
22f6f22012 Cleanup not required cleanup sql script
Since we introduced migration the init file is not required and it is a
leftover.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-12-10 14:42:24 +01:00
5b7ce84149 Add .env to .gitignore
Signed-off-by: Frederik Carlier <frederik.carlier@quamotion.mobi>
2020-12-07 23:31:00 +01:00
92ea28a0ad Force Unix line endings for shell scripts
Signed-off-by: Frederik Carlier <frederik.carlier@quamotion.mobi>
2020-12-07 23:31:00 +01:00
d04bee185a Merge pull request #28 from gianarb/fix/update-aptrepos-tag-workflow
Run apt-update before installing package in the tag workflow
2020-11-24 20:08:31 +01:00
ee992dd8d4 Run apt-update before installing package in the tag workflow
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-11-24 19:52:15 +01:00
1b408b0f4f Missed docker transport in release-binaries (#26)
Regression from f8cf83f121
2020-11-24 18:30:04 +00:00
c2c41101cb Merge branch 'master' into getbinaries-fix-transport 2020-11-24 18:28:04 +00:00
2db68f09b6 Unpack all image and not just the last layer (#27)
The go program we use to get binaries from a docker image was unpacking
only the last layer. This is not required and in order to have a more
generic approach and fewest requirement the program now unpack all the
image
2020-11-24 16:29:08 +00:00
84f4fa8533 Merge branch 'master' into unpack-all-image 2020-11-24 16:28:31 +00:00
f6b43ada0b Unpack all image and not just the last layer
The go program we use to get binaries from a docker image was unpacking
only the last layer. This is not required and it order to have a more
generic approach and fewest requirement the program now unpack all the
image

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-11-24 17:12:33 +01:00
2650e324df Missed docker transport in release-binaries
This is a regression introduced here f8cf83f121

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-11-24 17:08:08 +01:00
e08401172c bump boots to 45a64dad03795133adf7f7177677f3d58a0018e2 (#25)
bump boots to 45a64dad03795133adf7f7177677f3d58a0018e2
2020-11-24 15:44:45 +00:00
87fca37075 bump boots to 45a64dad03795133adf7f7177677f3d58a0018e2
The main reason for this bump is because we fixed multi arch support for
boots binaries. Before docker images were multi arch but boots was
always x86. This issue is not fixed.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-11-24 16:41:58 +01:00
1672752d56 Merge pull request #24 from tinkerbell/hotfix/use-current-versions
Use variables set in current_versions.sh as part of script/release-binaries.sh
2020-11-23 20:00:02 +05:30
f8cf83f121 Use variables set in current_versions.sh as part of
script/release-binaries.sh

When writing the release-binary bash script I didn't use the right
variables in current_versions.sh but I fixed those values as part of the
script itself.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-11-23 15:22:59 +01:00
10 changed files with 34 additions and 101 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Use Unix line endings for scripts
*.sh text eol=lf

View File

@ -7,7 +7,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- run: sudo apt install -y libgpgme-dev libassuan-dev libdevmapper-dev
- run: sudo apt-get update && sudo apt install -y libgpgme-dev libassuan-dev libdevmapper-dev
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-go@v2

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
envrc
out
.env

View File

@ -14,7 +14,7 @@ is running the hood. Sandbox runs a pinned version for all the components via
commit sha. In this way as a user you won't be effected (ideally) from new code
that will may change a bit how Tinkerbell works.
We are keeping the number of bc break as low as possible but in the current
We are keeping the number of breaking changes as low as possible but in the current
state they are expected.
## Binary release

View File

@ -98,14 +98,14 @@ func main() {
if err != nil {
log.Fatal(err)
}
err = copyBinaryFromLastLayer(path.Join(imgsDir, imgDir), path.Join(releaseDir, imgDir), binaryToCopy)
err = untarLayers(path.Join(imgsDir, imgDir), path.Join(releaseDir, imgDir), binaryToCopy)
if err != nil {
log.Fatal(err)
}
}
}
func copyBinaryFromLastLayer(src, dest, binaryPath string) error {
func untarLayers(src, dest, binaryPath string) error {
b, err := ioutil.ReadFile(path.Join(src, "manifest.json"))
if err != nil {
return err
@ -114,14 +114,15 @@ func copyBinaryFromLastLayer(src, dest, binaryPath string) error {
if err != nil {
return err
}
last := man.LayerInfos()[len(man.LayerInfos())-1]
layerTar, err := os.Open(path.Join(src, last.Digest.String()[7:]))
if err != nil {
return err
}
err = tar.Untar(src, layerTar)
if err != nil {
return err
for _, l := range man.LayerInfos() {
layerTar, err := os.Open(path.Join(src, l.Digest.String()[7:]))
if err != nil {
return err
}
err = tar.Untar(src, layerTar)
if err != nil {
return err
}
}
input, err := ioutil.ReadFile(path.Join(src, binaryPath))

View File

@ -4,9 +4,9 @@
# automation that needs to get the version of the programs currently supported
# in sandbox
export OSIE_DOWNLOAD_LINK=https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-v0-n=366,c=1aec189,b=master.tar.gz
export TINKERBELL_TINK_SERVER_IMAGE=quay.io/tinkerbell/tink:sha-0e8e5733
export TINKERBELL_TINK_CLI_IMAGE=quay.io/tinkerbell/tink-cli:sha-0e8e5733
export TINKERBELL_TINK_BOOTS_IMAGE=quay.io/tinkerbell/boots:sha-e81a291c
export TINKERBELL_TINK_HEGEL_IMAGE=quay.io/tinkerbell/hegel:sha-c17b512f
export TINKERBELL_TINK_WORKER_IMAGE=quay.io/tinkerbell/tink-worker:sha-0e8e5733
export OSIE_DOWNLOAD_LINK="https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-v0-n=404,c=c35a5f8,b=master.tar.gz"
export TINKERBELL_TINK_SERVER_IMAGE=quay.io/tinkerbell/tink:sha-57eb0efb
export TINKERBELL_TINK_CLI_IMAGE=quay.io/tinkerbell/tink-cli:sha-57eb0efb
export TINKERBELL_TINK_BOOTS_IMAGE=quay.io/tinkerbell/boots:sha-a449ad23
export TINKERBELL_TINK_HEGEL_IMAGE=quay.io/tinkerbell/hegel:sha-c8a68311
export TINKERBELL_TINK_WORKER_IMAGE=quay.io/tinkerbell/tink-worker:sha-57eb0efb

View File

@ -1,76 +0,0 @@
SET ROLE tinkerbell;
CREATE TABLE IF NOT EXISTS hardware (
id UUID UNIQUE
, inserted_at TIMESTAMPTZ
, deleted_at TIMESTAMPTZ
, data JSONB
);
CREATE INDEX IF NOT EXISTS idx_id ON hardware (id);
CREATE INDEX IF NOT EXISTS idx_deleted_at ON hardware (deleted_at NULLS FIRST);
CREATE INDEX IF NOT EXISTS idxgin_type ON hardware USING GIN (data JSONB_PATH_OPS);
CREATE TABLE IF NOT EXISTS template (
id UUID UNIQUE NOT NULL
, name VARCHAR(200) NOT NULL
, created_at TIMESTAMPTZ
, updated_at TIMESTAMPTZ
, deleted_at TIMESTAMPTZ
, data BYTEA
CONSTRAINT CK_name CHECK (name ~ '^[a-zA-Z0-9_-]*$')
);
CREATE INDEX IF NOT EXISTS idx_tid ON template (id);
CREATE INDEX IF NOT EXISTS idx_tdeleted_at ON template (deleted_at NULLS FIRST);
CREATE TABLE IF NOT EXISTS workflow (
id UUID UNIQUE NOT NULL
, template UUID NOT NULL
, devices JSONB NOT NULL
, created_at TIMESTAMPTZ
, updated_at TIMESTAMPTZ
, deleted_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS idx_wid ON workflow (id);
CREATE INDEX IF NOT EXISTS idx_wdeleted_at ON workflow (deleted_at NULLS FIRST);
CREATE TABLE IF NOT EXISTS workflow_state (
workflow_id UUID UNIQUE NOT NULL
, current_task_name VARCHAR(200)
, current_action_name VARCHAR(200)
, current_action_state SMALLINT
, current_worker VARCHAR(200)
, action_list JSONB
, current_action_index int
, total_number_of_actions INT
);
CREATE INDEX IF NOT EXISTS idx_wfid ON workflow_state (workflow_id);
CREATE TABLE IF NOT EXISTS workflow_event (
workflow_id UUID NOT NULL
, worker_id UUID NOT NULL
, task_name VARCHAR(200)
, action_name VARCHAR(200)
, execution_time int
, message VARCHAR(200)
, status SMALLINT
, created_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS idx_event ON workflow_event (created_at);
CREATE TABLE IF NOT EXISTS workflow_worker_map (
workflow_id UUID NOT NULL
, worker_id UUID NOT NULL
);
CREATE TABLE IF NOT EXISTS workflow_data (
workflow_id UUID NOT NULL
, version INT
, metadata JSONB
, data JSONB
);

View File

@ -65,7 +65,6 @@ services:
POSTGRES_PASSWORD: tinkerbell
POSTGRES_USER: tinkerbell
volumes:
- ./db/tinkerbell-init.sql:/docker-entrypoint-initdb.d/tinkerbell-init.sql:ro
- postgres_data:/var/lib/postgresql/data:rw
ports:
- 5432:5432

View File

@ -4,25 +4,25 @@ source ./current_versions.sh
go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/hegel \
-image docker://quay.io/tinkerbell/hegel:sha-c17b512f \
-image docker://${TINKERBELL_TINK_HEGEL_IMAGE} \
-program hegel
go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/boots \
-image docker://quay.io/tinkerbell/boots:sha-e81a291c \
-image docker://${TINKERBELL_TINK_BOOTS_IMAGE} \
-program boots
go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/tink-worker \
-image docker://quay.io/tinkerbell/tink-worker:sha-0e8e5733 \
-image docker://${TINKERBELL_TINK_WORKER_IMAGE} \
-program tink-worker
go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/tink-server \
-image docker://quay.io/tinkerbell/tink:sha-0e8e5733 \
-image docker://${TINKERBELL_TINK_SERVER_IMAGE} \
-program tink-server
go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/tink \
-image docker://quay.io/tinkerbell/tink-cli:sha-0e8e5733 \
-image docker://${TINKERBELL_TINK_CLI_IMAGE} \
-program tink

View File

@ -487,6 +487,12 @@ whats_next() (
echo "$BLANK Follow the steps described in https://tinkerbell.org/examples/hello-world/ to say 'Hello World!' with a workflow."
)
setup_nat() (
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
)
do_setup() (
# perform some very rudimentary platform detection
lsb_dist=$(get_distribution)
@ -504,7 +510,7 @@ do_setup() (
source "$ENV_FILE"
setup_networking "$lsb_dist" "$lsb_version"
setup_nat
setup_osie
generate_certificates
setup_docker_registry