linz / cotar Goto Github PK
View Code? Open in Web Editor NEWCloud optimised tar
License: Other
Cloud optimised tar
License: Other
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.
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.