Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test docker compose milestone 2 #332

Merged
merged 2 commits into from
Feb 8, 2025
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
39 changes: 21 additions & 18 deletions .github/workflows/python_publish_release_management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@ jobs:
with:
ref: main

- name: Setup Scanner CLI
shell: bash
run: |
SCANNER_DIR="$HOME/assets"
SCANNER_JAR="scanner_cli-2.2.8-all.jar"
SCANNER_URL="https://github.com/archguard/archguard/releases/download/v2.2.8/$SCANNER_JAR"

# Create directory if it doesn't exist
mkdir -p "$SCANNER_DIR"

# Download scanner CLI if not found
if [ ! -f "$SCANNER_DIR/$SCANNER_JAR" ]; then
echo "Downloading Scanner CLI..."
curl -L -o "$SCANNER_DIR/$SCANNER_JAR" "$SCANNER_URL"
else
echo "Scanner CLI already exists."
fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -122,5 +104,26 @@ jobs:
ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:latest
ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:${{ matrix.version }}

- name: Modify prod docker compose file with right image and version
uses: actions/github-script@v5
with:
script: |
const fs = require('fs');
const yaml = require('js-yaml');

// Read the docker-compose file
const filePath = '${{ matrix.path }}/prod-docker-compose.yml';
const fileContent = fs.readFileSync(filePath, 'utf8');
const compose = yaml.load(fileContent);

// Update the image for code-confluence-flow-bridge service
const newImage = `ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.image_name }}:${{ matrix.version }}`;
compose.services['code-confluence-flow-bridge'].image = newImage;

// Write back to file
fs.writeFileSync(filePath, yaml.dump(compose, { lineWidth: -1 }));

console.log(`Updated image to: ${newImage}`);



Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ tests
.pytest_cache
.ruff_Cache
.vscode
app/jars/scanner_cli-2.2.8-all.jar
mypy.ini
ruff.toml
tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ COPY . /app/
# Install dependencies using uv sync
RUN uv sync --frozen --no-cache

# Create directory for scanner and download scanner CLI
RUN mkdir -p /root/assets && \
curl -L -o /root/assets/scanner_cli-2.2.8-all.jar \
https://github.com/archguard/archguard/releases/download/v2.2.8/scanner_cli-2.2.8-all.jar

# Expose the port that the FastAPI app listens on
EXPOSE 8000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ services:
- NEO4J_USERNAME=neo4j
- NEO4J_PASSWORD=password
- TEMPORAL_SERVER_ADDRESS=temporal:7233
- SCANNER_JAR_PATH=/root/assets/scanner_cli-2.2.8-all.jar
depends_on:
temporal:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ services:
- NEO4J_USERNAME=neo4j
- NEO4J_PASSWORD=password
- TEMPORAL_SERVER_ADDRESS=temporal:7233
- SCANNER_JAR_PATH=/root/assets/scanner_cli-2.2.8-all.jar
image: ghcr.io/unoplat/code-confluence-flow-bridge:0.9.0
depends_on:
temporal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from src.code_confluence_flow_bridge.models.configuration.settings import ProgrammingLanguageMetadata
from src.code_confluence_flow_bridge.parser.package_manager.package_manager_parser import PackageManagerParser

from loguru import logger
from temporalio import activity
from temporalio.exceptions import ApplicationError

Expand All @@ -28,7 +29,7 @@ def get_package_metadata(self, local_path: str, programming_language_metadata: P
"""
try:
info = activity.info()
activity.logger.info(
logger.info(
"Processing package metadata",
extra={
"temporal_workflow_id": info.workflow_id,
Expand All @@ -42,9 +43,9 @@ def get_package_metadata(self, local_path: str, programming_language_metadata: P

package_metadata = self.package_manager_parser.parse_package_metadata(local_workspace_path=local_path, programming_language_metadata=programming_language_metadata)

activity.logger.info("Successfully processed package metadata", extra={"temporal_workflow_id": info.workflow_id, "temporal_activity_id": info.activity_id, "codebase_path": local_path, "status": "success"})
logger.info("Successfully processed package metadata", extra={"temporal_workflow_id": info.workflow_id, "temporal_activity_id": info.activity_id, "codebase_path": local_path, "status": "success"})
return package_metadata

except Exception as e:
activity.logger.error("Failed to process package metadata", extra={"temporal_workflow_id": activity.info().workflow_id, "temporal_activity_id": activity.info().activity_id, "error_type": type(e).__name__, "error_details": str(e), "codebase_path": local_path, "status": "error"})
logger.error("Failed to process package metadata", extra={"temporal_workflow_id": activity.info().workflow_id, "temporal_activity_id": activity.info().activity_id, "error_type": type(e).__name__, "error_details": str(e), "codebase_path": local_path, "status": "error"})
raise ApplicationError(message=f"Failed to process package metadata for {local_path}", type="PACKAGE_METADATA_ERROR")
75 changes: 0 additions & 75 deletions unoplat-code-confluence-ingestion/temporal-links-python.txt

This file was deleted.