Skip to content

Commit

Permalink
merged with master
Browse files Browse the repository at this point in the history
  • Loading branch information
psrvere committed Nov 11, 2024
2 parents 4364973 + 44779c2 commit f35ec15
Show file tree
Hide file tree
Showing 206 changed files with 11,712 additions and 3,717 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/cve-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Weekly Trivy Scan

on:
schedule:
- cron: '0 0 * * 1' # Run every Monday at midnight
workflow_dispatch:

jobs:
trivy_scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Trivy
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.56.2
- name: Run Trivy scan
run: |
trivy fs --security-checks vuln .
13 changes: 9 additions & 4 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
Expand All @@ -29,19 +32,21 @@ jobs:
with:
images: dicedb/dicedb

- name: Build and push Docker image
- name: Build and push Docker image (with cache)
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

cache-from: type=gha # This tells Buildx to attempt to use the GitHub Actions cache
cache-to: type=gha,mode=max # This stores the generated cache in the GitHub Actions cache

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: docker.io/dicedb/dicedb
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
push-to-registry: true
12 changes: 10 additions & 2 deletions .github/workflows/full-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
- name: Cache dependencies
uses: actions/cache@v3
with: # Cache the Go modules
path: |
vendor/
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go get .
run: go get -v . # Check if there is any version changes from the cache
- name: Build
run: make build
- name: Run Unit tests
run: make unittest
- name: Run Integration tests
run: make test
run: make test
13 changes: 10 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: linter
name: Linter

on:
push:
branches: [ master ]
branches: [master]
paths:
- '*.go'

pull_request:
branches: [ master ]
branches: [master]
paths:
- '*.go'

permissions:
contents: read
Expand All @@ -22,3 +28,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.1

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DiceDB
<a href="https://dicedb.io/get-started/installation/">![Docs](https://img.shields.io/badge/docs-00A1FF?style=flat-square)</a>
<a target="_blank" href="https://discord.gg/6r8uXWtXh7"><img src="https://dcbadge.limes.pink/api/server/6r8uXWtXh7?style=flat" alt="discord community" /></a>

DiceDB is a redis-compliant, in-memory, real-time, and reactive database optimized for modern hardware and for building and scaling truly real-time applications.
DiceDB is a redis-compliant, reactive, scalable, highly available, unified cache optimized for modern hardware.

We are looking for Early Design Partners, so, if you want to evaluate DiceDB, [block our calendar](https://cal.com/dicedb-arpit). always up for a chat.

Expand All @@ -32,7 +32,7 @@ Although DiceDB is a drop-in replacement of Redis, which means almost no learnin

## Get started

### Setting up DiceDB with Dockerc
### Setting up DiceDB with Docker

The easiest way to get started with DiceDB is using [Docker](https://www.docker.com/) by running the following command.

Expand Down
1 change: 1 addition & 0 deletions build_protos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
protoc --go_out=. ./internal/wal/wal.proto
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ var (
EnableProfiling = false

EnableWatch = true
LogDir = ""

EnableWAL = true
RestoreFromWAL = false
WALEngine = "sqlite"
)

type Config struct {
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
DiceDB welcomes your contributions! Whether you're fixing bugs, adding new features, or improving the documentation, your help is valuable.
DiceDB welcomes your contributions! Whether you're fixing bugs, adding new features, or improving the documentation, your help is valuable.

To maintain the project's quality and consistency, please follow these guidelines:

- Keep the code consistent: Use the same coding style and conventions throughout the project.
- Keep the git repository consistent: Follow proper git practices to avoid conflicts and ensure a clean history.
- Keep the code consistent: Use the same coding style and conventions throughout the project.
- Keep the git repository consistent: Follow proper git practices to avoid conflicts and ensure a clean history.

# Contribution Guidelines

Expand Down
12 changes: 1 addition & 11 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineConfig({
// },
{
label: "SDK",
autogenerate: { directory: "sdk" },
autogenerate: { directory: "sdk" },
},
{
label: "Connection Protocols",
Expand All @@ -36,16 +36,6 @@ export default defineConfig({
label: "Commands",
autogenerate: { directory: "commands" },
},
{
label: "Metrics",
items: [
{
label: "Memtier Benchmark",
link: "https://dicedb.io/metrics/memtier.html",
attrs: { target: "_blank" },
},
],
},
],
}),
],
Expand Down
41 changes: 28 additions & 13 deletions docs/command_docs_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: <CMD NAME HERE>
description: description here in 2 to 3 lines
---

<!-- description in 2 to 3 sentences, following is an example -->
<!-- for sample template please check sample_command_docs.md file -->

Expand All @@ -15,58 +16,67 @@ description: description here in 2 to 3 lines
<!-- please mention them in subcommands section and create their individual documents -->

## Parameters
<!-- please add all parameters, small description, type and required, see example for SET command-->
| Parameter | Description | Type | Required |
|-----------|---------------------------------------------------------------------------|---------|----------|
| | | | |
| | | | |
| | | | |

<!-- please add all parameters, small description, type and required, see example for SET command-->

| Parameter | Description | Type | Required |
| --------- | ----------- | ---- | -------- |
| | | | |
| | | | |
| | | | |

## Return values

<!-- add all scenarios, see below example for SET -->

| Condition | Return Value |
|------------------------------------------------|---------------------------------------------------|
| | |
| | |
| | |
| Condition | Return Value |
| --------- | ------------ |
| | |
| | |
| | |

## Behaviour

<!-- How does the command execute goes here, kind of explaining the underlying algorithm -->
<!-- see below example for SET command -->
<!-- Please modify for the command by going through the code -->

- Bullet 1
- Bullet 2
- Bullet 3

## Errors

<!-- sample errors, please update for commands-->
<!-- please add all the errors here -->
<!-- incase of a dynamic error message, feel free to use variable names -->
<!-- follow below bullet structure -->

1. `Wrong type of value or key`:

- Error Message: `(error) WRONGTYPE Operation against a key holding the wrong kind of value`
- Occurs when attempting to use the command on a key that contains a non-string value.


## Example Usage

<!-- please add examples for the command -->
<!-- Its good to have example using flags and arguments -->
<!-- Also adding for errors provide idea about the command -->

<!-- example heading in h3 -->

### Basic Usage

<!-- Always use bash code style block -->

```bash
127.0.0.1:7379> SET foo bar
OK
```

<!-- Please use detailed scenarios and edges cases if possible -->
<!-- example heading in h3 -->

### Invalid usage

```bash
Expand All @@ -81,20 +91,25 @@ OK
<!-- anything related to the command which cannot be shared in other sections -->

<!-- Optional -->

## Best Practices

<!-- Optional -->

## Alternatives

<!-- Optional -->
## Notes

## Notes

<!-- Optional -->

## Subcommands

<!-- if the command you are working on has subcommands -->
<!-- please mention them here and add links to the pages -->
<!-- please see below example for COMMAND docs -->
<!-- follow below bullet structure -->

- **subcommand**: Optional. Available subcommands include:
- `subcommand1` : some description of the subcommand.
Loading

0 comments on commit f35ec15

Please sign in to comment.