Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright The Linux Foundation and each contributor to LFX.
# SPDX-License-Identifier: MIT

.git
.gitignore
.dockerignore
/bin/
*.sh
*.pem
.env
*.env

# Helm chart dependencies
/charts/*/charts/
*.tgz

# Local and temporary files
.DS_Store
.idea/
.vscode/
*.swp
*~

# Rendered templates
**/templates/*.rendered
**/templates/*.generated.yaml
**/templates/_*.tpl.rendered

# MegaLinter reports
/megalinter-reports/

# Python environment for meltano
.venv/
__pycache__/
.mypy_cache/
.ruff_cache/

# Documentation
README.md
*.md
LICENSE*

# Test files
*_test.go
testdata/

# Development files
Makefile
7 changes: 3 additions & 4 deletions .github/workflows/ko-build-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: v1-sync-helper/go.mod
go-version-file: go.mod
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
with:
version: v0.18.0
- working-directory: ./v1-sync-helper
run: |
ko build github.com/linuxfoundation/lfx-v1-sync-helper \
- run: |
ko build github.com/linuxfoundation/lfx-v1-sync-helper/cmd/lfx-v1-sync-helper \
-B \
--platform linux/amd64,linux/arm64 \
-t ${{ github.sha }} \
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ko-build-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ jobs:
- name: Setup Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: v1-sync-helper/go.mod
go-version-file: go.mod

- name: Setup Ko
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
with:
version: v0.18.0

- name: Build and publish container image
working-directory: ./v1-sync-helper
run: |
ko build github.com/linuxfoundation/lfx-v1-sync-helper \
ko build github.com/linuxfoundation/lfx-v1-sync-helper/cmd/lfx-v1-sync-helper \
-B \
--platform linux/amd64,linux/arm64 \
-t ${{ github.ref_name }} \
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*~
.env
*.env
*.pem

# Rendered templates
**/templates/*.rendered
Expand All @@ -27,3 +28,6 @@
__pycache__/
.mypy_cache/
.ruff_cache/

# Go build artifacts
/bin/
6 changes: 4 additions & 2 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ ignore: |
styles
venv
.venv
charts
meltano
charts/lfx-v1-sync-helper/templates
rules:
line-length:
max: 120
level: warning
indentation:
# Meltano doesn't indent sequences, but we otherwise do.
indent-sequences: whatever
24 changes: 11 additions & 13 deletions v1-sync-helper/Makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# SPDX-License-Identifier: MIT

# Binary name
BINARY_NAME=v1-sync-helper
BINARY_NAME=lfx-v1-sync-helper
BINARY_PATH=bin/$(BINARY_NAME)
CMD_PATH=cmd/lfx-v1-sync-helper

# Go parameters
GOCMD=go
Expand All @@ -28,13 +29,13 @@ all: clean deps fmt lint test build
build:
@echo "Building $(BINARY_NAME)..."
@mkdir -p bin
$(GOBUILD) $(BUILD_FLAGS) -o $(BINARY_PATH) .
$(GOBUILD) $(BUILD_FLAGS) -o $(BINARY_PATH) ./$(CMD_PATH)

# Build with debug symbols and race detection
debug:
@echo "Building $(BINARY_NAME) with debug symbols..."
@mkdir -p bin
$(GOBUILD) $(DEBUG_FLAGS) -o $(BINARY_PATH) .
$(GOBUILD) $(DEBUG_FLAGS) -o $(BINARY_PATH) ./$(CMD_PATH)

# Clean build artifacts
clean:
Expand Down Expand Up @@ -101,20 +102,17 @@ run-debug: debug
# Build Docker image
docker-build:
@echo "Building Docker image..."
docker build -t ghcr.io/linuxfoundation/lfx-v1-sync-helper/$(BINARY_NAME):latest .
docker build -f docker/Dockerfile.v1-sync-helper -t ghcr.io/linuxfoundation/lfx-v1-sync-helper/$(BINARY_NAME):latest .

# Run Docker container
docker-run: docker-build
@echo "Running Docker container..."
@if [ ! -f .env ]; then \
echo "Error: .env file not found. Please create one from cmd/lfx-v1-sync-helper/config.example.env"; \
exit 1; \
fi
docker run --rm -p 8080:8080 \
-e NATS_URL=nats://localhost:4222 \
-e PROJECT_SERVICE_URL=http://localhost:8080 \
-e HEIMDALL_CLIENT_ID=v1_sync_helper \
-e HEIMDALL_PRIVATE_KEY="$(shell cat /path/to/heimdall-private-key.pem)" \
-e AUTH0_TENANT=linuxfoundation-dev \
-e AUTH0_CLIENT_ID=your-auth0-client-id \
-e AUTH0_PRIVATE_KEY="$(shell cat /path/to/auth0-private-key.pem)" \
-e LFX_API_GW=https://api-gw.dev.platform.linuxfoundation.org/ \
--env-file .env \
ghcr.io/linuxfoundation/lfx-v1-sync-helper/$(BINARY_NAME):latest

# Update dependencies
Expand All @@ -141,6 +139,6 @@ help:
@echo " run - Build and run the application"
@echo " run-debug - Build with debug and run the application"
@echo " docker-build - Build Docker image"
@echo " docker-run - Build and run Docker container"
@echo " docker-run - Build and run Docker container (requires .env file)"
@echo " update-deps - Update all dependencies"
@echo " help - Show this help message"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This repository contains three main components:
### [Meltano](./meltano/README.md)
Data extraction and loading pipeline that extracts data from LFX v1 sources (DynamoDB for meetings, PostgreSQL for projects/committees) and loads it into NATS KV stores for processing by the v2 platform.

### [v1-sync-helper](./v1-sync-helper/README.md)
### [v1-sync-helper](./cmd/lfx-v1-sync-helper/README.md)
Go service that monitors NATS KV stores for replicated v1 data and synchronizes it with the LFX v2 platform APIs, handling data transformation and conflict resolution.

### [Helm charts](./charts/lfx-v1-sync-helper/README.md)
Expand Down
2 changes: 1 addition & 1 deletion charts/lfx-v1-sync-helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The following environment variables have defaults configured in the chart's `app
| `PORT` | `8080` | HTTP server port |
| `BIND` | `*` | Interface to bind on |

For a complete list of all supported environment variables, including required ones like `AUTH0_TENANT`, see the [v1-sync-helper README](../../v1-sync-helper/README.md#environment-variables).
For a complete list of all supported environment variables, including required ones like `AUTH0_TENANT`, see the [v1-sync-helper README](../../cmd/lfx-v1-sync-helper/README.md#environment-variables).

### Additional Configuration

Expand Down
8 changes: 4 additions & 4 deletions charts/lfx-v1-sync-helper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ nats:
# storage is the storage type for the KV bucket
storage: file
# maxValueSize is the maximum size of a value in the KV bucket
maxValueSize: 10485760 # 10MB
maxValueSize: 10485760 # 10MB
# maxBytes is the maximum number of bytes in the KV bucket
maxBytes: 10737418240 # 10GB
maxBytes: 10737418240 # 10GB
# compression is a boolean to determine if the KV bucket should be compressed
compression: true

Expand All @@ -94,9 +94,9 @@ nats:
# storage is the storage type for the KV bucket
storage: file
# maxValueSize is the maximum size of a value in the KV bucket
maxValueSize: 10485760 # 10MB
maxValueSize: 10485760 # 10MB
# maxBytes is the maximum number of bytes in the KV bucket
maxBytes: 2147483648 # 2GB
maxBytes: 2147483648 # 2GB
# compression is a boolean to determine if the KV bucket should be compressed
compression: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The LFX v1 Sync Helper is a Go microservice that synchronizes v1 data from NATS

### Data Flow

For a more detail view, see the root [README.md](../README.md) diagrams.
For a more detail view, see the root [README.md](../../README.md) diagrams.

```mermaid
flowchart LR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// Committee-specific client operations for the v1-sync-helper service.
// The lfx-v1-sync-helper service.
package main

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// Project-specific client operations for the v1-sync-helper service.
// The lfx-v1-sync-helper service.
package main

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// Configuration management for v1-sync-helper service
// The lfx-v1-sync-helper service.
package main

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// The v1-sync-helper service.
// The lfx-v1-sync-helper service.
package main

import (
Expand Down Expand Up @@ -95,6 +95,10 @@ func handleKVPut(ctx context.Context, entry jetstream.KeyValueEntry) {
handleZoomPastMeetingSummaryUpdate(ctx, key, v1Data)
case "itx-zoom-past-meetings":
handleZoomPastMeetingUpdate(ctx, key, v1Data)
case "salesforce-merged_user":
logger.With("key", key).DebugContext(ctx, "salesforce-merged_user sync not yet implemented")
case "salesforce-alternate_email__c":
handleAlternateEmailUpdate(ctx, key, v1Data)
default:
logger.With("key", key).WarnContext(ctx, "unknown object type, ignoring")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// Committee-specific handlers for the v1-sync-helper service.
// The lfx-v1-sync-helper service.
package main

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// Package main provides HTTP handlers for meeting-related operations.
// The lfx-v1-sync-helper service.
package main

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT

// Project-specific handlers for the v1-sync-helper service.
// The lfx-v1-sync-helper service.
package main

import (
Expand Down
Loading