Compare commits

..

No commits in common. "5ff556b7d39b8f7ef2e3f47c0f899bdd0f189dbb" and "38b6b62aba5a3c3a7fc07f5fb918f7315c1bb03e" have entirely different histories.

4 changed files with 18 additions and 51 deletions

View file

@ -12,6 +12,4 @@ Dockerfile
*.warc.zst
.git
scraper/debug/
*/target/
scraper-rs/target/
*.db*
*/target/

View file

@ -11,7 +11,7 @@ env:
jobs:
check:
name: chequear typescript del sitio
runs-on: ubicloud-standard-4
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
@ -31,7 +31,7 @@ jobs:
build-and-push-sitio:
name: Compilar contenedor del sitio
needs: check
runs-on: buildjet-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
@ -59,13 +59,13 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
platforms: linux/amd64
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/sitio:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/sitio:buildcache,mode=max
platforms: linux/amd64,linux/arm64
build-and-push-scraper-amd64:
name: "[amd64] oci:scraper"
runs-on: ubicloud-standard-16
build-and-push-scraper:
name: Compilar contenedor del scraper
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
@ -91,38 +91,6 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
platforms: linux/amd64
build-and-push-scraper-arm64:
name: "[arm64] oci:scraper"
runs-on: ubicloud-standard-16-arm
permissions:
contents: read
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scraper
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:scraper-rs/"
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
platforms: linux/arm64
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scraper:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scraper:buildcache,mode=max
platforms: linux/amd64,linux/arm64

View file

@ -1,11 +1,12 @@
FROM docker.io/node:20 AS base
FROM cgr.dev/chainguard/wolfi-base AS base
WORKDIR /usr/src/app
FROM base as build
RUN apk add --no-cache nodejs npm
RUN npm install --global pnpm
COPY db-datos/package.json db-datos/package.json
COPY sitio/package.json sitio/package.json
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
COPY pnpm-lock.yaml pnpm-workspace.yaml .
RUN cd sitio && pnpm install
COPY . .
COPY db-datos/drizzle .
@ -15,7 +16,7 @@ RUN cd sitio && \
FROM base
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y jq sqlite3 && apt-get clean
RUN apk add --no-cache nodejs npm jq sqlite
# Sitio
COPY --from=build /usr/src/app/sitio/package.json package.real.json
@ -27,4 +28,4 @@ COPY --from=build /usr/src/app/db-datos/drizzle drizzle
ENV DB_PATH=/db/db.db
EXPOSE 3000
CMD ["node", "."]
CMD ["node", "."]

View file

@ -82,7 +82,7 @@ pub async fn get_urls() -> anyhow::Result<Vec<String>> {
let client = build_client();
let initial = Url::parse("https://www.cotodigital3.com.ar/sitios/cdigi/browse?Nf=product.endDate%7CGTEQ+1.7032032E12%7C%7Cproduct.startDate%7CLTEQ+1.7032032E12&Nr=AND%28product.sDisp_200%3A1004%2Cproduct.language%3Aespa%C3%B1ol%2COR%28product.siteId%3ACotoDigital%29%29")?;
let page_size = 50;
let page_size = 100;
let handles: Vec<Vec<String>> = stream::iter(0..29000 / page_size)
.map(|i| {
let mut u = initial.clone();