mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 03:26:19 +00:00
Compare commits
No commits in common. "5ff556b7d39b8f7ef2e3f47c0f899bdd0f189dbb" and "38b6b62aba5a3c3a7fc07f5fb918f7315c1bb03e" have entirely different histories.
5ff556b7d3
...
38b6b62aba
4 changed files with 18 additions and 51 deletions
|
@ -13,5 +13,3 @@ Dockerfile
|
||||||
.git
|
.git
|
||||||
scraper/debug/
|
scraper/debug/
|
||||||
*/target/
|
*/target/
|
||||||
scraper-rs/target/
|
|
||||||
*.db*
|
|
||||||
|
|
54
.github/workflows/container.yml
vendored
54
.github/workflows/container.yml
vendored
|
@ -11,7 +11,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: chequear typescript del sitio
|
name: chequear typescript del sitio
|
||||||
runs-on: ubicloud-standard-4
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v3
|
- uses: pnpm/action-setup@v3
|
||||||
|
@ -31,7 +31,7 @@ jobs:
|
||||||
build-and-push-sitio:
|
build-and-push-sitio:
|
||||||
name: Compilar contenedor del sitio
|
name: Compilar contenedor del sitio
|
||||||
needs: check
|
needs: check
|
||||||
runs-on: buildjet-4vcpu-ubuntu-2204
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
@ -59,13 +59,13 @@ jobs:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/sitio:buildcache
|
||||||
cache-to: type=inline
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/sitio:buildcache,mode=max
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
build-and-push-scraper-amd64:
|
build-and-push-scraper:
|
||||||
name: "[amd64] oci:scraper"
|
name: Compilar contenedor del scraper
|
||||||
runs-on: ubicloud-standard-16
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
@ -91,38 +91,6 @@ jobs:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scraper:buildcache
|
||||||
cache-to: type=inline
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scraper:buildcache,mode=max
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
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
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
FROM docker.io/node:20 AS base
|
FROM cgr.dev/chainguard/wolfi-base AS base
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
FROM base as build
|
FROM base as build
|
||||||
|
RUN apk add --no-cache nodejs npm
|
||||||
RUN npm install --global pnpm
|
RUN npm install --global pnpm
|
||||||
COPY db-datos/package.json db-datos/package.json
|
COPY db-datos/package.json db-datos/package.json
|
||||||
COPY sitio/package.json sitio/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
|
RUN cd sitio && pnpm install
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY db-datos/drizzle .
|
COPY db-datos/drizzle .
|
||||||
|
@ -15,7 +16,7 @@ RUN cd sitio && \
|
||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
ENV NODE_ENV=production
|
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
|
# Sitio
|
||||||
COPY --from=build /usr/src/app/sitio/package.json package.real.json
|
COPY --from=build /usr/src/app/sitio/package.json package.real.json
|
||||||
|
|
|
@ -82,7 +82,7 @@ pub async fn get_urls() -> anyhow::Result<Vec<String>> {
|
||||||
let client = build_client();
|
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 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)
|
let handles: Vec<Vec<String>> = stream::iter(0..29000 / page_size)
|
||||||
.map(|i| {
|
.map(|i| {
|
||||||
let mut u = initial.clone();
|
let mut u = initial.clone();
|
||||||
|
|
Loading…
Reference in a new issue