Skip to content

Commit

Permalink
✨ Add sample script for demo server
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone committed Oct 11, 2023
1 parent dd2db1b commit a2affda
Show file tree
Hide file tree
Showing 36 changed files with 511 additions and 67 deletions.
4 changes: 2 additions & 2 deletions cmd/builder/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (b Builder) initCache() error {
if err != nil {
return fmt.Errorf("Rename cache_out to cache_in failed: %v", err)
}
log.Info().Str("size", humanize.BigBytes(big.NewInt(fileInfo.Size()))).Msg("Decompress cache success")
log.Info().Str("size", humanize.BigIBytes(big.NewInt(fileInfo.Size()))).Msg("Decompress cache success")
}
var dirs = []string{cacheOut, cacheIn}
for _, dir := range dirs {
Expand Down Expand Up @@ -177,6 +177,6 @@ func (b Builder) exportCache() error {
if err != nil {
return fmt.Errorf("Export cache to server failed: %v", err)
}
log.Info().Str("size", humanize.BigBytes(big.NewInt(fileInfo.Size()))).Msg("Export cache success")
log.Info().Str("size", humanize.BigIBytes(big.NewInt(fileInfo.Size()))).Msg("Export cache success")
return nil
}
1 change: 1 addition & 0 deletions cmd/imports/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package imports

import (
_ "github.com/go-sigma/sigma/pkg/daemon/afpushed"
_ "github.com/go-sigma/sigma/pkg/daemon/builder"
_ "github.com/go-sigma/sigma/pkg/daemon/coderepo"
_ "github.com/go-sigma/sigma/pkg/daemon/gc"
Expand Down
3 changes: 2 additions & 1 deletion conf/config-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ redis:
cache:
# the cache type available is: redis, inmemory, database
type: database
ttl: 72h
# please attention in multi
inmemory:
size: 10240
redis:
ttl: 72h
database:
size: 10240
threshold: 0.2
Expand Down Expand Up @@ -133,6 +133,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFUR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Zz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
github:
Expand Down
5 changes: 3 additions & 2 deletions conf/config-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ database:
# The database type to use. Supported types are: sqlite3, mysql, postgresql
type: sqlite3
sqlite3:
path: sigma.db
path: /var/lib/sigma/sigma.db
mysql:
host: localhost
port: 3306
Expand Down Expand Up @@ -37,8 +37,8 @@ cache:
type: redis
inmemory:
size: 10240
ttl: 72h
redis:
ttl: 72h
database:
size: 10240
threshold: 0.2
Expand Down Expand Up @@ -131,6 +131,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrVlF6aFpuQUhNZGgKbk5UUklxRFJqckF1UmhDN3U5MmR1b0w0S2s0a0JZNTRBa2JxQnRJZytZUXd1ODBnbDJrTjR0L3hqcWFveXl1VApDSGV3OXlwa3BONFFQTGZ1TU1OYjhYUktSdFV2cGlVekZkRmpGTkQ4eS9haVBkVlRYdVRNbGhUNjcvOXphbXlRCmtUU1V5c1l3aUtLSlRxb0N5SkFMTXRtekNrVHNTY0cxeURhcjh2cldWWDdtMnpVR0pRaW5QTllpV1JSS3IySWMKbUVTRXM3ZkROWm8zbnNka05sWEZNUWorZWVVa25Ebmk1VmtENFV1aVpBTmNXTHE4ckpBV0hTTEFtcUltK1BGUgpJVmZvcDZ0d3M5dXlUNWR2d0s2cldJcE9RRG5iZWhSM2FmU2ljY2YzQXVGNldLTFVJd05hanBhaThPdWZmYkFkClpSVTBBa2pFb2h5a1JxZ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VgKckFPaUhzVHQ5TFNZUXNZUmpEcGZqR0t1b29jN091Q1ZGdGYwa1ArUkliODJIK05QRVNPMXlpclNzMTVaWnFobAorTXpmY1YrL1dHOVovZlAyUG5ZYVFCeWFOWkNMK3dSTW5nbXJycnF1RjZSRXk1UHQ5Z2pkaU1heXhSSzlVODVKCkY4WFVqcmhuVTJYMUxHTFAzaEoxV0lUbTh6V2RlcytyZU1JR2RNL3grajRBbW80R3FuMzd1U05WRkR4QVhuV2gKRzhPejBaa0dXb25Xai9CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
github:
Expand Down
7 changes: 4 additions & 3 deletions conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ database:
# The database type to use. Supported types are: sqlite3, mysql, postgresql
type: sqlite3
sqlite3:
path: sigma.db
path: /var/lib/sigma/sigma.db
mysql:
host: localhost
port: 3306
Expand Down Expand Up @@ -37,11 +37,11 @@ redis:
cache:
# the cache type available is: redis, inmemory, database
type: database
ttl: 72h
# please attention in multi
inmemory:
size: 10240
redis:
ttl: 72h
database:
size: 10240
threshold: 0.2
Expand Down Expand Up @@ -88,7 +88,7 @@ storage:
rootdirectory: ./storage
type: filesystem
filesystem:
path: /var/lib/sigma/oci/
path: /var/lib/sigma/
s3:
ak: sigma
sk: sigma-sigma
Expand Down Expand Up @@ -139,6 +139,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTF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 1 addition & 0 deletions docs/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSB"
oauth2:
github:
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/push/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Push image to sigma

### Push single image to sigma

``` sh
``` bash
docker pull redis:7
docker tag redis:7 127.0.0.1:3000/library/redis:7
docker push 127.0.0.1:3000/library/redis:7
Expand All @@ -24,7 +24,7 @@ Create 'buildkit.toml' with content:

Create buildx instance:

``` sh
``` bash
docker buildx create --use --config ./buildkit.toml
```

Expand All @@ -36,6 +36,6 @@ FROM alpine:3.18

Push multiarch image to sigma:

``` sh
``` bash
docker buildx build --platform linux/amd64,linux/arm64 --tag 10.3.201.221:3000/library/alpine:3.18.0 --file alpine.Dockerfile --push .
```
8 changes: 4 additions & 4 deletions docs/docs/push/helm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ description: Push helm chart to sigma

### Generate a sample helm chart

``` sh
``` bash
helm create demo
```

This command will create 'demo' directory, and a sample helm chart in it.

``` sh
``` bash
helm package demo
```

Expand All @@ -26,14 +26,14 @@ You can see the v3.13.0 [release note](https://github.com/helm/helm/releases/tag

Before helm version v3.13.0:

``` sh
``` bash
helm registry login --insecure -u sigma -p sigma 127.0.0.1:3000
helm push demo-0.1.0.tgz oci://127.0.0.1:3000/library/demo --insecure-skip-tls-verify
```

After helm version v3.13.0:

``` sh
``` bash
helm registry login -u sigma -p sigma 127.0.0.1:3000
helm push demo-0.1.0.tgz oci://127.0.0.1:3000/library/demo --plain-http
```
18 changes: 13 additions & 5 deletions docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@ sidebar_position: 1

# Quick Start

Let's discover **sigma in less than 5 minutes**.
Let's discover **sigma in less than 3 minutes**.

## Getting Started

Run sigma in Docker. If you want to use the builder, Docker version should be used latest.
Run sigma in Docker. If you want to use the builder, Docker version should be used the latest version.
The builder will push image to server, so we should link the together, you should create network for them.
And set the network name `daemon.builder.docker.network` in `config.yaml`.

``` sh
``` bash
# create network
docker network create sigma
# run the sigma in docker
docker run --name sigma -v /home/admin/config:/etc/sigma \
-v /home/admin/storage:/var/lib/sigma \
-v /var/run/docker.sock:/var/run/docker.sock -p 443:3000 \
-d ghcr.io/go-sigma/sigma:nightly-alpine
-d --net sigma ghcr.io/go-sigma/sigma:nightly-alpine
```

That's enough, now you got a service like docker hub or harbor.

Push image to sigma.

``` sh
``` bash
docker pull redis:7
docker tag redis:7 127.0.0.1:3000/library/redis:7
docker push 127.0.0.1:3000/library/redis:7
Expand Down
2 changes: 1 addition & 1 deletion pkg/configs/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ type ConfigurationRedis struct {

// ConfigurationCacheRedis ...
type ConfigurationCacheRedis struct {
Ttl time.Duration `yaml:"ttl"`
}

// ConfigurationCacheInmemory ...
Expand All @@ -122,6 +121,7 @@ type ConfigurationCacheDatabase struct {
// ConfigurationCache ...
type ConfigurationCache struct {
Type enums.CacherType `yaml:"type"`
Ttl time.Duration `yaml:"ttl"`
Redis ConfigurationCacheRedis `yaml:"redis"`
Inmemory ConfigurationCacheInmemory `yaml:"inmemory"`
Database ConfigurationCacheDatabase `yaml:"database"`
Expand Down
Loading

0 comments on commit a2affda

Please sign in to comment.