Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Graphcool Deploy creating bloated built #457

Open marktani opened 6 years ago

marktani commented 6 years ago

Issue by Boid-John Wednesday Jan 10, 2018 at 20:20 GMT Originally opened as https://github.com/graphcool/prisma/issues/1573


Macs-MacBook-Pro:boidgraphcool boid$ du -hs .
 25M    .
Macs-MacBook-Pro:boidgraphcool boid$ ls -a
.       .git        .vscode     graphcool.yml   package.json
..      .gitignore  README.md   logs.txt    src
.DS_Store   .graphcoolrc    events      node_modules    types.graphql
Macs-MacBook-Pro:boidgraphcool boid$ graphcool deploy
  config CWD /Users/boid/Dev/boid/boidgraphcool +0ms
  config HOME /Users/boid +2ms
  config definitionDir /Users/boid/Dev/boid/boidgraphcool +0ms
  config definitionPath /Users/boid/Dev/boid/boidgraphcool/graphcool.yml +0ms
  config homepath /Users/boid/.graphcoolrc +0ms
  config localRCPath /Users/boid/Dev/boid/boidgraphcool/.graphcoolrc +0ms
  config globalRCPath /Users/boid/.graphcoolrc +0ms
  cli command id deploy +0ms
  cli:plugincache Got plugin from cache +0ms
  cli:plugincache /Users/boid/Library/Caches/graphcool/plugins.json +0ms
  cli:plugincache Got plugin from cache +2ms
  cli:plugincache /Users/boid/Library/Caches/graphcool/plugins.json +0ms
  plugins findCommand graphcool-cli-core +0ms
  plugin requiring command +0ms
  cli-engine:plugins:manager requiring /usr/local/lib/node_modules/graphcool/node_modules/graphcool-cli-core +0ms
  cli-engine:plugins:manager required +561ms
  plugin required command +565ms
  deploy run +0ms
  client choosing clusterEndpoint https://api.graph.cool/system +0ms
  client Sending query +0ms
  client 
  client       query ($projectId: ID!){
  client         viewer {
  client           project(id: $projectId) {
  client             ...RemoteProject
  client           }
  client         }
  client       }
  client       
  client   fragment RemoteProject on Project {
  client     id
  client     name
  client     schema
  client     alias
  client     region
  client     isEjected
  client     projectDefinitionWithFileContent
  client   }
  client 
  client        +0ms
  client { projectId: 'cjairjkxk2ea90149d6i52vdh' } +1ms
  deploy bundling +653ms
  bundler /Users/boid/Dev/boid/boidgraphcool/.build/build.zip +0ms
Bundling functions...  bundler added files [ '.DS_Store',
  '.git/',
  '.gitignore',
  '.graphcoolrc',
  '.vscode/',
  'README.md',
  'events/',
  'graphcool.yml',
  'logs.txt',
  'node_modules/',
  'package.json',
  'src/',
  'types.graphql',
  '.build/build.zip',
  '.build/dist/',
  '.git/COMMIT_EDITMSG',
  '.git/FETCH_HEAD',
  '.git/HEAD',
  '.git/config',
  '.git/description',
  '.git/hooks/',
  '.git/index',
  '.git/info/',
  '.git/logs/',
  '.git/objects/',
  '.git/refs/',
  '.vscode/settings.json',
  'events/authenticate/',
  'events/leaderboard/',
  'events/signup/',
  'events/updateDevicePower/',
  'events/updateDevicePowers/',
  'events/updateUserPower/',
  'events/updateWalletBalance/',
  'node_modules/.DS_Store',
  'node_modules/.bin/',
  'node_modules/@types/',
  'node_modules/apollo-fetch/',
  'node_modules/apollo-link/',
  'node_modules/apollo-link-http/',
  'node_modules/apollo-utilities/',
  'node_modules/axios/',
  'node_modules/bcryptjs/',
  'node_modules/cross-fetch/',
  'node_modules/debug/',
  'node_modules/decode-uri-component/',
  'node_modules/deprecated-decorator/',
  'node_modules/encoding/',
  'node_modules/es6-promise/',
  'node_modules/escape-goat/',
  'node_modules/follow-redirects/',
  'node_modules/get-urls/',
  'node_modules/graphcool-lib/',
  'node_modules/graphql/',
  'node_modules/graphql-request/',
  'node_modules/graphql-subscriptions/',
  'node_modules/graphql-tools/',
  'node_modules/human-interval/',
  'node_modules/iconv-lite/',
  'node_modules/ip-regex/',
  'node_modules/is-buffer/',
  'node_modules/is-plain-obj/',
  'node_modules/is-stream/',
  'node_modules/isomorphic-fetch/',
  'node_modules/iterall/',
  'node_modules/ms/',
  'node_modules/node-fetch/',
  'node_modules/normalize-url/',
  'node_modules/object-assign/',
  'node_modules/prepend-http/',
  'node_modules/query-string/',
  'node_modules/shorthash/',
  'node_modules/sort-keys/',
  'node_modules/source-map/',
  'node_modules/source-map-support/',
  'node_modules/strict-uri-encode/',
  'node_modules/tlds/',
  'node_modules/url-regex/',
  'node_modules/uuid/',
  'node_modules/validator/',
  'node_modules/whatwg-fetch/',
  'node_modules/zen-observable/',
  'node_modules/zen-observable-ts/',
  'src/.DS_Store',
  'src/db.js',
  'src/devicePowerRatingCreated.graphql',
  'src/email-password/',
  'src/leaderboard.graphql',
  'src/lib/',
  'src/permissions/',
  'src/powerRatingCreated.graphql',
  'src/tokenTransactionCreated.graphql',
  'src/updateDevicePower.js',
  'src/updateUserPower.js',
  'src/updateWalletBalance.js',
  'src/userImage.js',
  'src/workDataCreated.graphql',
  '.git/hooks/applypatch-msg.sample',
  '.git/hooks/commit-msg.sample',
  '.git/hooks/post-update.sample',
  ... 1437 more items ] +305ms
  ts-builder starting compile [ '/Users/boid/Dev/boid/boidgraphcool/src/authenticate.js',
  '/Users/boid/Dev/boid/boidgraphcool/src/loggedInUser.js',
  '/Users/boid/Dev/boid/boidgraphcool/src/signup.js',
  '/Users/boid/Dev/boid/boidgraphcool/src/leaderboard.js' ] +3ms
  ts-builder created program +415ms
  ts-builder emitted +476ms
  bundler converted files [ '/Users/boid/Dev/boid/boidgraphcool/src/authenticate.js',
  '/Users/boid/Dev/boid/boidgraphcool/src/loggedInUser.js',
  '/Users/boid/Dev/boid/boidgraphcool/src/signup.js',
  '/Users/boid/Dev/boid/boidgraphcool/src/leaderboard.js' ] +7ms
  bundler createdFiles [ '/Users/boid/Dev/boid/boidgraphcool/.build/dist/src/authenticate.js',
  '/Users/boid/Dev/boid/boidgraphcool/.build/dist/src/loggedInUser.js',
  '/Users/boid/Dev/boid/boidgraphcool/.build/dist/src/lib/nameGen.js',
  '/Users/boid/Dev/boid/boidgraphcool/.build/dist/src/userImage.js',
  '/Users/boid/Dev/boid/boidgraphcool/.build/dist/src/signup.js',
  '/Users/boid/Dev/boid/boidgraphcool/.build/dist/src/leaderboard.js' ] +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/ src/ +22ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/authenticate-dev.js src/authenticate-dev.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/authenticate-lambda.js src/authenticate-lambda.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/authenticate.js src/authenticate.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/byline.js src/byline.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/leaderboard-dev.js src/leaderboard-dev.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/leaderboard-lambda.js src/leaderboard-lambda.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/leaderboard.js src/leaderboard.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/lib/ src/lib/ +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/loggedInUser-dev.js src/loggedInUser-dev.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/loggedInUser-lambda.js src/loggedInUser-lambda.js +1ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/loggedInUser.js src/loggedInUser.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/signup-dev.js src/signup-dev.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/signup-lambda.js src/signup-lambda.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/signup.js src/signup.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/userImage.js src/userImage.js +0ms
  bundler adding /Users/boid/Dev/boid/boidgraphcool/.build/dist/src/lib/nameGen.js src/lib/nameGen.js +0ms
  bundler added build files [ 'src/',
  'src/authenticate-dev.js',
  'src/authenticate-lambda.js',
  'src/authenticate.js',
  'src/byline.js',
  'src/leaderboard-dev.js',
  'src/leaderboard-lambda.js',
  'src/leaderboard.js',
  'src/lib/',
  'src/loggedInUser-dev.js',
  'src/loggedInUser-lambda.js',
  'src/loggedInUser.js',
  'src/signup-dev.js',
  'src/signup-lambda.js',
  'src/signup.js',
  'src/userImage.js',
  'src/lib/nameGen.js' ] +0ms
  client choosing clusterEndpoint https://api.graph.cool/system +1m
  client Sending query +1ms
  client 
  client       mutation getUrl($projectId: String!) {
  client         getTemporaryDeployUrl(
  client           input: {
  client           projectId: $projectId
  client         }
  client       ) {
  client           url
  client         }
  client       }
  client      +0ms
  client { projectId: 'cjairjkxk2ea90149d6i52vdh' } +0ms
  bundler uploading to https://graphcool-lambda-deploy-us-west-2.s3-us-west-2.amazonaws.com/cjc9hyesv52oe01896wby1hgj?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20180110T200740Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3599&X-Amz-Credential=AKIAJF7CPII4GVUUIGEQ%2F20180110%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=cb8c3843d791c92dc722457f8b803b7e7af81d3da147c6e79e17c822a1ce319e +1m

During the upload, I checked the size of the generated .build folder

Macs-MacBook-Pro:boidgraphcool boid$ ls -a
.       .git        README.md   node_modules
..      .gitignore  events      package.json
.DS_Store   .graphcoolrc    graphcool.yml   src
.build      .vscode     logs.txt    types.graphql
Macs-MacBook-Pro:boidgraphcool boid$ du -hs .build/
1.8G    .build/

I found a broken 1GB zip file inside the build.zip, not sure where it came from...

Macs-MacBook-Pro:.build boid$ ls -a
.       .git        README.md   graphcool.yml   src
..      .gitignore  build.zip   logs.txt    types.graphql
.DS_Store   .graphcoolrc    dist        node_modules
.build      .vscode     events      package.json
Macs-MacBook-Pro:.build boid$ cd .build
Macs-MacBook-Pro:.build boid$ ls
build.zip   dist
Macs-MacBook-Pro:.build boid$ ls -a
.       ..      build.zip   dist
Macs-MacBook-Pro:.build boid$ unzip build.zip
Archive:  build.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of build.zip or
        build.zip.zip, and cannot find build.zip.ZIP, period.