Closed OrfeasLitos closed 5 years ago
Tried playing around with ASSIGNMENT_FOLDER
env var, to no avail.
You need to clone the assignments repo into that directory
On Sat, Mar 9, 2019, 22:11 Orfeas Stefanos Thyfronitis Litos < notifications@github.com> wrote:
Tried playing around with ASSIGNMENT_FOLDER env var, to no avail.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/decrypto-org/blockchain-course/issues/38#issuecomment-471217842, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhPPOmRH7kP1gjnj9v8Ytmz2GSXkV5-ks5vVBVwgaJpZM4bm4Q0 .
It used to work before I pulled. There's already a bunch of assignments there.
I tried removing everything and copying over the entire assignments repo, I npm install
ed and update
d in the root of the repo, in api
and in app
and got this when doing yarn start
in api
:
yarn start
yarn run v1.13.0
$ nodemon --watch . --watch $(realpath node_modules/blockchain-course-db) --watch index.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.* /home/orfeas/repositories/blockchain-course/api/node_modules/blockchain-course-db index.js
[nodemon] starting `node index.js`
internal/modules/cjs/loader.js:651
throw err;
^
Error: Cannot find module 'blockchain-course-db'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
at Function.Module._load (internal/modules/cjs/loader.js:575:25)
at Module.require (internal/modules/cjs/loader.js:705:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object.<anonymous> (/home/orfeas/repositories/blockchain-course/api/controllers/AssignmentController.js:6:59)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
[nodemon] app crashed - waiting for file changes before starting...
Did you run yarn install within the updated assignments repo? A lot has changed...
On Sat, Mar 9, 2019, 22:45 Orfeas Stefanos Thyfronitis Litos < notifications@github.com> wrote:
It used to work before I pulled. There's already a bunch of assignments there.
I tried removing everything and copying over the entire assignments repo, I npm installed and updated in the root of the repo, in api and in app and got this when doing yarn start in api:
yarn start yarn run v1.13.0 $ nodemon --watch . --watch $(realpath node_modules/blockchain-course-db) --watch index.js [nodemon] 1.18.10 [nodemon] to restart at any time, enter
rs
[nodemon] watching: . /home/orfeas/repositories/blockchain-course/api/node_modules/blockchain-course-db index.js [nodemon] startingnode index.js
internal/modules/cjs/loader.js:651 throw err; ^Error: Cannot find module 'blockchain-course-db' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15) at Function.Module._load (internal/modules/cjs/loader.js:575:25) at Module.require (internal/modules/cjs/loader.js:705:19) at require (internal/modules/cjs/helpers.js:14:16) at Object.
(/home/orfeas/repositories/blockchain-course/api/controllers/AssignmentController.js:6:59) at Module._compile (internal/modules/cjs/loader.js:799:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10) at Module.load (internal/modules/cjs/loader.js:666:32) at tryModuleLoad (internal/modules/cjs/loader.js:606:12) at Function.Module._load (internal/modules/cjs/loader.js:598:3) [nodemon] app crashed - waiting for file changes before starting... — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/decrypto-org/blockchain-course/issues/38#issuecomment-471220438, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhPPOEvFqTEbHYUP2GVp_3hZAZGsqVnks5vVB2CgaJpZM4bm4Q0 .
Ran yarn install
everywhere (api, app, root, assignments repo). The same.
Did you pull the latest changes from assignment's repo ?
The Error: Cannot find module 'blockchain-course-db'
indicates that you have to yarn link
inside db
folder and yarn link blockchain-course-db
inside api
and cli
folder
The issue is with the default db directory. The current directory for the relative path of db/models/custom/assignment.js
, line 6 is taken to be the path from which the script was invoked. I.e. to make it work I had to go to db/assignments/dutch-auction
and run node ../../../cli/cli.js
.
And the next problem was:
Error: Judge folder has not been declared. Did you assign the JUDGE_FOLDER variable inside .env?
A sensible default can help here.
After playing around with the judge folder, I get
$ node ../../../cli/cli.js
sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators ../../node_modules/sequelize/lib/sequelize.js:242:13
[ 'LICENSE',
'README.md',
'assignment-helpers.js',
'dutch-auction',
'faucet',
'judges.js',
'merkle-tree',
'node_modules',
'package.json',
'proof-of-work',
'public-key',
'reverse-sha',
'simple-storage',
'vickrey-auction',
'winston.js',
'yarn.lock' ]
cli.js <command>
Commands:
cli.js generate <command> Generate <aux>
cli.js get <command> Get an entity <assignment>
cli.js judge <id> Judge a solution for a specific assignment
cli.js stats <command> Get user stats <top|last|score>
Options:
--version Show version number [boolean]
--help Show help [boolean]
(node:5376) V8: /home/orfeas/repositories/blockchain-course/db/node_modules/solc/soljson.js:3 Invalid asm.js: Invalid member of stdlib
And the next problem was:
Error: Judge folder has not been declared. Did you assign the JUDGE_FOLDER variable inside .env?
A sensible default can help here.
This is an issue regarding assignments which is in another repository and outside the scope of this repository. Nevertheless, as we are the same authors, we can not predict in which folder you will put your JUDGE_FOLDER
and so what default is sensible enough.
I think is better to think the structure as follows: There is the blockchain-course
repository that contains the api, web app, db and cli. Given the structure that we have, anyone can make a module , compatible with our logic, that implements various assignments. How they will implement this module is their choice. In our case we made the assignments repository with a JUDGE_FOLDER
variable as a mandatory variable that must be filled by the user.
Do I have to understand the entire architecture? I just want to write exercises.
No you don't. That's why you have to declare only two variables (absolute path).
I agree with Orfeas that maybe we should have a reasonable default for the location of the exercises folder. If you want, you can change it. Otherwise you just clone in the predetermined location.
On Mon, Mar 11, 2019, 16:58 Christos Nasikas notifications@github.com wrote:
No you don't. That's why you have to declare only two variables.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/decrypto-org/blockchain-course/issues/38#issuecomment-471574124, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhPPPDVDn-G8ryVvAckDEzU4U3nR93qks5vVm8RgaJpZM4bm4Q0 .
We have already a reasonable default.
Correction: I mean for the judge location. The judge location within the assignments folder should be assumed to live in the location in which it would end up if you just cloned the assignments dir into the prespecified location within the blockchain-course dir.
Why do we need an absolute path there by the way?
Why do we need an absolute path there by the way?
Will be fixed at #39
Correction: I mean for the judge location. The judge location within the assignments folder should be assumed to live in the location in which it would end up if you just cloned the assignments dir into the prespecified location within the blockchain-course dir.
If you remember we had exactly the structure you are describing. The judge folder were inside the assignments folder. We made this change because we want the assignments folder to be empty so you can git clone
inside the folder. If you want a default location for the judge folder please open an issue or a PR in the assignments repository as this issue has nothing to do with this repository.
I do not suggest that we go back to the previous structure. The way things are now is how they should be -- the assignments folder should be empty. The difference is that the judge path in the assignments repo should have a reasonable default, assuming the assignments repo will be cloned in the correct location. I'll open an issue on that repo.
I'm closing this as the initial question was solved. I'll open a separate issue for the paths.