Coder Social home page Coder Social logo

cotar's People

Contributors

blacha avatar dependabot[bot] avatar dwsilk avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cotar's Issues

@orphan.io

[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]()]() over@ {}Orion.io

Cloudflare Workers error: Code generation from strings disallowed for this context

Hi,

really good work.
Unfortunately I have problems setting up a cotar reader in my environment. I'm using Cloudflare R2 (S3-compatible) and Cloudflare Workers (similar to AWS Lambda).

I successfully created a tar file and indexed it with the cotar cli.
Then I created the cloudflare worker:

import { Cotar, CotarIndexBinary } from '@cotar/core';
import { fsa } from '@chunkd/fs'

export interface Env { }

export default {
	async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
		const source = fsa.source('https://example.com/example.tar.co');
		const cotar = await Cotar.fromTar(source);

		// Fetch a gzipped PBF file from  a tar
		const bytes = await cotar.get(`tiles/z10/5/5.pbf.gz`);

		return new Response(bytes);
	},
};

But I'm getting the following error message when I try to execute it:

service core:user:cotar_test: Uncaught Error: EvalError: Code generation from strings disallowed for this context
at worker.js:740:18 in generateSingleObject
at worker.js:730:12 in StrutTypeObjectGenerated
at worker.js:886:12 in object
at worker.js:920:20

It seems that it has something to do with the generateSingleObject function in the binparse repo.

In a blog post I found the following explanation:

As the error says code generation is not allowed in Functions/Pages. So using eval or new Function is not allowed. This is done for security reasons.

I also tried creating the worker with the cotar-rs package. But unfortunately http paths aren't implemented yet.

Fails to index huge tars >120 million files

I have a ~100GB 262Million file SQLite database (MBTiles), that I am attempting to convert into a cotar.

The tar creation process fails after 120M files as the hash map containing the previous hashes overflows (NodeJS limit)

Some options:

  1. Split the output tar into multiple smaller chunks (20-30GB ea) so that they contain roughly 100M files each
  2. Switch the hash table to be a tree to support much larger table sizes (Would have creation performance imapacts)
  3. Rewrite the creation into a language that supports BigMaps by default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.