bobbai00 commented on code in PR #4387:
URL: https://github.com/apache/texera/pull/4387#discussion_r3108689222


##########
.github/workflows/check-binary-licenses.yml:
##########
@@ -0,0 +1,154 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Check binary dependency licenses
+
+on:
+  pull_request:
+    paths:
+      - '**/build.sbt'
+      - 'project/plugins.sbt'
+      - 'project/AddMetaInfLicenseFiles.scala'
+      - 'frontend/package.json'
+      - 'frontend/yarn.lock'
+      - 'amber/requirements.txt'
+      - 'amber/operator-requirements.txt'
+      - 'LICENSE-binary'
+      - 'NOTICE-binary'
+      - 'bin/licensing/**'
+      - '.github/workflows/check-binary-licenses.yml'
+  workflow_dispatch:
+
+permissions:
+  contents: read
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+jobs:
+  check-jvm-deps:
+    name: Check JVM dependencies
+    runs-on: ubuntu-22.04
+    env:
+      JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M 
-Dfile.encoding=UTF-8
+      JVM_OPTS:  -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M 
-Dfile.encoding=UTF-8
+    services:
+      postgres:
+        image: postgres
+        env:
+          POSTGRES_PASSWORD: postgres
+        ports:
+          - 5432:5432
+        options: >-
+          --health-cmd="pg_isready -U postgres"
+          --health-interval=10s
+          --health-timeout=5s
+          --health-retries=5
+    steps:
+      - uses: actions/checkout@v5
+      - uses: actions/setup-java@v5
+        with:
+          distribution: temurin
+          java-version: 11
+      - uses: actions/setup-python@v6
+        with:
+          python-version: '3.12'
+      - uses: sbt/setup-sbt@508b753e53cb6095967669e0911487d2b9bc9f41 # v1.1.22
+      - uses: coursier/cache-action@4e2615869d13561d626ed48655e1a39e5b192b3c # 
v6.4.9
+        with:
+          extraSbtFiles: '["*.sbt", "project/**.{scala,sbt}", 
"project/build.properties" ]'
+      - name: Create databases (required by sbt dist wiring)
+        run: |
+          psql -h localhost -U postgres -f sql/texera_ddl.sql
+          psql -h localhost -U postgres -f sql/iceberg_postgres_catalog.sql
+          psql -h localhost -U postgres -f sql/texera_lakefs.sql
+        env:
+          PGPASSWORD: postgres
+      - name: Build distributable bundles
+        # Build every dist-producing module so the union of bundled jars can
+        # be diffed against LICENSE-binary.
+        run: sbt 'clean; ConfigService/dist; AccessControlService/dist; 
FileService/dist; ComputingUnitManagingService/dist; 
WorkflowCompilingService/dist; WorkflowExecutionService/dist'
+      - name: Unzip each dist
+        run: |
+          mkdir -p /tmp/dists
+          for zip in \
+            config-service/target/universal/config-service-*.zip \
+            
access-control-service/target/universal/access-control-service-*.zip \
+            file-service/target/universal/file-service-*.zip \
+            
computing-unit-managing-service/target/universal/computing-unit-managing-service-*.zip
 \
+            
workflow-compiling-service/target/universal/workflow-compiling-service-*.zip \
+            amber/target/universal/amber-*.zip; do
+              unzip -q "$zip" -d /tmp/dists/
+          done
+      - name: Check bundled jars against LICENSE-binary
+        run: |
+          ./bin/licensing/check_binary_deps.py jar \
+            /tmp/dists/config-service-*/lib \
+            /tmp/dists/access-control-service-*/lib \
+            /tmp/dists/file-service-*/lib \
+            /tmp/dists/computing-unit-managing-service-*/lib \
+            /tmp/dists/workflow-compiling-service-*/lib \
+            /tmp/dists/amber-*/lib
+
+  check-npm-deps:
+    name: Check npm dependencies
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v5
+      - uses: actions/setup-node@v5
+        with:
+          node-version: 18
+      - uses: actions/setup-python@v6
+        with:
+          python-version: '3.12'
+      - uses: actions/cache@v4
+        with:
+          path: |
+            frontend/.yarn/cache
+            frontend/.yarn/unplugged
+            frontend/.yarn/install-state.gz
+          key: ${{ runner.os }}-yarn-license-${{ 
hashFiles('frontend/yarn.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-yarn-license-
+      - name: Prepare Yarn 4.5.1
+        run: corepack enable && corepack prepare [email protected] --activate && yarn 
--cwd frontend set version 4.5.1
+      - name: Install frontend dependencies
+        run: yarn --cwd frontend install --immutable --inline-builds 
--network-timeout=100000
+      - name: Production build (emits 3rdpartylicenses.txt)
+        run: yarn --cwd frontend run build
+      - name: Check bundled npm packages against LICENSE-binary
+        run: ./bin/licensing/check_binary_deps.py npm 
frontend/dist/3rdpartylicenses.txt
+
+  check-python-deps:
+    name: Check Python dependencies
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v5
+      - uses: actions/setup-python@v6
+        with:
+          python-version: '3.12'
+      - name: Install Python dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r amber/requirements.txt
+          pip install -r amber/operator-requirements.txt
+          pip install pip-licenses
+      - name: Generate pip-licenses manifest
+        run: pip-licenses --format=csv > /tmp/pip-licenses.csv

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to