wellcometrust / player

Navigate sequences of images in a zoomable, extensible interface.
http://player.digirati.co.uk/
Other
32 stars 11 forks source link

Cannot build #2

Closed ghalusa closed 5 years ago

ghalusa commented 9 years ago

Hi,

I tried building... multiple times. Each failed. Once on Mac OS X (10.10.2), another trial on a Nitrous box (Ubuntu 12.04.5 LTS), another on a Digital Ocean Droplet (Ubuntu 14.04 x64).

I thoroughly ran through the installation instructions:

Install Node.js Install the Grunt - run npm install -g grunt-cli Clone the 'player' repository On the command line, go in to the 'player' folder Run git submodule init Run git submodule update Run npm install

grunt build ...

Hopefully, you can help. Thanks!

View Error From the Digital Ocean Droplet

Gist: Wellcome Player Error

edsilv commented 9 years ago

Hi,

I just tried a clean clone and install and it worked, but it looks like you're on tsc v1.0.1 whereas I'm currently using v1.0.3.

Try doing a npm install -g typescript to get the latest version of the typescript compiler.

Also, you may want to check out the Universal Viewer which is a related project and represents the current "state of the art". Please note however that the UV uses the standardised IIIF image and presentation protocols, rather than the Deepzoom DZI image protocol and "hand-rolled" presentation format that the Wellcome Player uses.

ghalusa commented 9 years ago

Thanks Edward. I'll try installing typescript globally and let you know how that goes. Thanks for pointing me to the Universal Viewer. I'll surely check it out.

Stay tuned...

ghalusa commented 9 years ago

OK... updated typescript:

me@player:~/player$ pwd
/home/me/player

me@player:~/player$ npm list -g --depth=0
/usr/local/lib
├── grunt-cli@0.1.13
├── npm@2.5.1
└── typescript@1.4.1

me@player:~/player$ npm list --depth=0
WellcomePlayer@1.0.0 /home/me/player
├── grunt@0.4.5
├── grunt-contrib-clean@0.4.1
├── grunt-contrib-compress@0.5.3
├── grunt-contrib-connect@0.8.0
├── grunt-contrib-copy@0.4.1
├── grunt-contrib-less@0.11.4
├── grunt-exec@0.4.6
├── grunt-extend@0.4.2
├── grunt-karma@0.9.0
├── grunt-text-replace@0.3.12
├── grunt-ts@1.11.13
├── karma@0.12.32
├── karma-chrome-launcher@0.1.7
├── karma-coverage@0.2.7
├── karma-cucumberjs@0.0.2
├── karma-jasmine@0.1.5
├── karma-phantomjs-launcher@0.1.4
├── karma-requirejs@0.2.2
└── requirejs@2.1.16

It keeps reporting that it's using tsc v1.0.1:

### Fast Compile >>src/modules/coreplayer-treeviewleftpanel-module/treeViewLeftPanel.ts
### Fast Compile >>src/utils.ts
Using tsc v1.0.1
/home/me/player/node_modules/grunt-ts/node_modules/typescript/bin/tsc.js:906
                        vector.release();

Could it be because during the install, it's looking for node.js v0.8? (I'm running the latest: 0.12.1)

me@player:~/player$ npm install
npm WARN package.json WellcomePlayer@1.0.0 No repository field.
npm WARN engine karma@0.12.31: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.1","npm":"2.5.1"})
npm WARN optional dep failed, continuing fsevents@0.3.5

For what it's worth, I did clear npm's cache using:

npm cache clean
edsilv commented 9 years ago

I upgraded from node v0.8 to v0.12.2, this yielded the same build error that you're seeing. I then updated grunt-ts to v4.0.1 in package.json and did an npm install.

This fixed the current error, but I'm now unable to build the dependencies.ts files due to A 'return' statement can only be used within a function body. errors.

I remember seeing these before and it's what originally prevented me from upgrading node. I need to figure out an alternate method of loading the dependencies - probably using requirejs text:

https://github.com/requirejs/text

I'll have a look at doing this and will let you know if I get it working. In the meantime, the only option is to downgrade to node v0.8

edsilv commented 9 years ago

https://github.com/wellcomelibrary/player/commit/2735e800562fe79999e37eea811e8ac527642641

It should now build with node v0.12.2 and ts v4.0.1. You'll need to do an npm install after pulling.

edsilv commented 9 years ago

FYI this is also implemented on the UV: https://github.com/UniversalViewer/universalviewer/commit/7649a07b4d69e8644e8ce54dc3e8c68ac0d9e974

ghalusa commented 9 years ago

Hey...

So, I tried again, from scratch. Ran into issues... looked like the same outcome for both Wellcome Player and Universal Player.

Look, I completely understand if this is a bit too much. If you're super busy, it's ok...

But, for the record, and for what it's worth, I posted a Gist, detailing the entire process, from start to finish... including a screenshot of the error produced in Google Chrome:

https://gist.github.com/ghalusa/0b2b1bb5e51e6b2795ff

edsilv commented 9 years ago

The build looks ok now.

The IP for localhost in your example looks unusual. When I run serve it uses the localhost host name, which resolves to ::1 or 127.0.0.1. Perhaps you need to add an entry to your hosts file?

Failing that, it could be something to do with the combination of grunt-contrib-connect settings on your system. I had to fiddle with this section of the Gruntfile.js quite a bit:

    connect: {
        dev: {
            options: {
                port: '<%= global.port %>',
                base: '.',
                directory: '.',
                keepalive: true,
                open: {
                    target: 'http://localhost:<%= global.port %>/<%= global.examplesDir %>/'
                }
            }
        }
    }

It's a bit of a stab in the dark, but you could try changing base to __dirname:

http://stackoverflow.com/questions/20914005/grunt-403-forbidden-error

Failing that, you could try serving the files with the trusty http-server:

https://www.npmjs.com/package/http-server

ghalusa commented 9 years ago

My /etc/hosts

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Gruntfile.js

Tried to fiddle with it, no change.

__dirname

Tried changing base to __dirname, no change.

http-server

Tried, no change.

My Environment

Your Environment?

edsilv commented 9 years ago

I'm running Windows 8.1

I don't have anything set in my hosts file.

Perhaps it's worth trying to get a 'hello world' type application working first with grunt-contrib-connect?

ghalusa commented 9 years ago

Ah... Windows. Good to know.

Indeed... a 'hello world' type application with grunt-contrib-connect would be a great place to start. I'll do that, and let you know how things pan out.

Thanks for all of your help... greatly appreciated.

edsilv commented 9 years ago

No probs! :-)

ghalusa commented 9 years ago

Edward,

Good news! I finally have a clean running instance of the Wellcome Player!

Digital Ocean - Ubuntu 14.04 x64 http://spirls.com:8001/

I started with the "hello world" test with grunt-contrib-connect. Everything went smoothly.

So...

Remember, or perhaps not... either way... I mentioned the "error produced in Google Chrome"? I provided the screenshot, depicting the fact that it couldn't find "examples-config.js".

Well, it got me thinking. I figured that's what the "Error: Forbidden" was all about. At that point, I decided to modify the Gruntfile.js file, explicitly assigning the "examples" directory to the "connect.dev.options" (as opposed to '.'). And... BAM! Done deal.

global config

global:
{
    buildDir: 'build/wellcomeplayer',
    minify: 'optimize=none',
    packageDirName: packageDirName,
    packageDir: 'build/' + packageDirName,
    examplesDir: 'examples',
    theme: 'coreplayer-default-theme',
    port: '8001',
    base: 'examples'
},

connect.dev.options

connect: {
    dev: {
        options: {
            port: '<%= global.port %>',
            hostname: '*',
            directory: '.',
            base: '<%= global.base %>',
            keepalive: true,
            open: true
        }
    }
}
edsilv commented 9 years ago

Awesome, glad you got it working!

On 9 April 2015 at 21:42, Goran Halusa notifications@github.com wrote:

Edward,

Good news! I finally have a clean running instance of the Wellcome Player!

Digital Ocean - Ubuntu 14.04 x64 http://spirls.com:8001/

I started with the "hello world" test with grunt-contrib-connect. Everything went smoothly.

So...

Remember, or perhaps not... either way... I mentioned the "error produced in Google Chrome"? I provided the screenshot https://camo.githubusercontent.com/cee9e24cdbb95ed620671dcb1f743b868c603276/687474703a2f2f68616c7573616e6174696f6e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30332f676f6f676c655f6368726f6d655f636f736f6c655f77656c6c636f6d652e706e67, depicting the fact that it couldn't find "examples-config.js".

Well, it got me thinking. I figured that's what the "Error: Forbidden" was all about. At that point, I decided to modify the Gruntfile.js file, explicitly assigning the "examples" directory to the "connect.dev.options" (as opposed to '.'). And... BAM! Done deal. global config

global: { buildDir: 'build/wellcomeplayer', minify: 'optimize=none', packageDirName: packageDirName, packageDir: 'build/' + packageDirName, examplesDir: 'examples', theme: 'coreplayer-default-theme', port: '8001', base: 'examples' },

connect.dev.options

connect: { dev: { options: { port: '<%= global.port %>', hostname: '*', directory: '.', base: '<%= global.base %>', keepalive: true, open: true } } }

— Reply to this email directly or view it on GitHub https://github.com/wellcomelibrary/player/issues/2#issuecomment-91350948 .

edsilv commented 9 years ago

I tried this setting on my environment and got "forbidden" errors. Ideally everyone would be able to use the same settings regardless of environment. I then tried removing the base and directory options from connect and it worked without them..! Perhaps I originally needed these and a more recent update to connect has fixed something..? Anyway, could you see what happens if you remove them too?

ghalusa commented 9 years ago

OK. I removed the base and directory options. The console in Google Chrome dev tools returned:

GET http://spirls.com:8001/examples-config.js 404 (Not Found) -- app.js:13

ghalusa commented 9 years ago

BTW, here is npm list:

me@me:~/player$ npm list --depth=0
WellcomePlayer@1.0.0 /home/me/player
├── grunt@0.4.5
├── grunt-contrib-clean@0.4.1
├── grunt-contrib-compress@0.5.3
├── grunt-contrib-connect@0.8.0
├── grunt-contrib-copy@0.4.1
├── grunt-contrib-less@0.11.4
├── grunt-exec@0.4.6
├── grunt-extend@0.4.2
├── grunt-karma@0.9.0
├── grunt-text-replace@0.3.12
├── grunt-ts@4.0.1
├── http-server@0.8.0 extraneous
├── karma@0.12.32
├── karma-chrome-launcher@0.1.7
├── karma-coverage@0.2.7
├── karma-cucumberjs@0.0.3
├── karma-jasmine@0.1.5
├── karma-phantomjs-launcher@0.1.4
├── karma-requirejs@0.2.2
└── requirejs@2.1.17
edsilv commented 9 years ago

Yep, we're on the same version of grunt-contrib-connect.

Ok, looks like we'll have to use different configs.

ghalusa commented 9 years ago

Weird. There must be a solution. I'm going to be doing some implementation with some of our content. If I happen to have an ah-ha moment, I will surely let you know :)

At least its high up in the food chain, at the config level. But, like you, I'm not wild about it either.

edsilv commented 9 years ago

Yeah, a bit sub-optimal, but at least everything else seems to work..!

I've just pushed a fix for a bug that I introduced with the build process when I altered the way the dependencies files work. This is also pushed to the UV.

There's currently a trade-off between the Wellcome Player and the Universal Viewer. The Wellcome Player has support for OpenSeadragon, audio, video, and PDF extensions, whereas the UV only supports OpenSeadragon due to the (current) limitations of the IIIF presentation API.

The Wellcome Player uses a "hand-rolled" format of our own devising:

http://player.digirati.co.uk/data-model.html

which predates, but isn't actually a million miles from the IIIF presentation API:

http://iiif.io/api/presentation/2.0/

In some work for the British Library, we ported the Wellcome Player to work with IIIF and subsequently added more features such as right-to-left manifest support, an expanded thumbnail view, a settings dialogue, and internationalisation.

We are currently endeavoring to upgrade the Wellcome Library's systems to IIIF. Although the legacy player will still be needed to view audio, video, and PDF content for the time being.

I think that IIIF support for other types of collections may be on the agenda at the conference in May.

Looking forward to seeing your content!

ghalusa commented 9 years ago

Thanks for the extensive overview. All good to know. And... as always, thanks for your time and impressive work.

BTW, you should know... I just went ahead and reinstalled, built, and tested the Universal Viewer. It went smooth as silk. No alterations to the config. No errors. Sweet!

We will be at the conference in May. It will be great to touch base!

edsilv commented 9 years ago

Hooray!

Yep, we should definitely meet up. Do you know about the developer round table the day before the main event?

http://www.eventbrite.com/e/iiif-technical-working-session-tickets-16158912743

It's sold out now unfortunately. Maybe (if you haven't already got a ticket) someone will drop out and a space will become available. Worth keeping an eye on.

BTW, the Wellcome Player also supports search within and authentication/authorisation. I'm working on search within support for the UV right now, but this isn't an approved feature in the IIIF spec yet. We're hoping to be able to demo search within around the time of the conference using our own IIIF extension.

https://groups.google.com/forum/#!topic/iiif-discuss/oI4HZznBa90

Authorisation is currently a topic of some debate too:

https://gist.github.com/tomcrane/3a2301058615ddf9dbee

ghalusa commented 9 years ago

No, I wasn't aware of the developer round table. Thanks for the heads-up. I'll keep my eye on that for openings.

Looking forward to learning more about the search capabilities... good stuff!

Just so you are aware, I just started working for Quotient, under the Smithsonian contract, less than 2 months ago. That is to say, I'm still quite green in this specific realm, but plowing through things day to day. Some of what you throw at me may take me a bit to digest :)

ghalusa commented 5 years ago

Closing. Ancient history.