« first day (3265 days earlier)      last day (1906 days later) » 

20:00
@duhaime I kid. What's your question
Well, I create a little container with docker build --tag wonk --file Dockerfile .
Next I want to kick off a process in that container to process some data in ./data on my host, so I try to run: docker run -v $(pwd)/data:/data -c "cd /data && chomp"
@rlemon Feel free to join XD
chomp should take a long time and write output to ./data on my host, but nothing happens
I don't think docker run does what you think it does
How did you assemble that command
Ah, doesn't it create a container from an image, or an instance of the image?
By "it" I mean "docker run"
20:04
yeah, it'll generally spin up a new container
Right, that's what I want isn't it? I thought I want to create a container, aka instance of my image, and run my chomp command in that container
but you're not specifying an image anywhere in your docker run command
@rlemon If I use an observable will that fix the issue do you think?
oh sorry, I'm simplifying greatly. My run command looks like: docker run -v $(pwd)/data:/data wonk /bin/bash -c "cd /data && chomp"
can you run your image interactively
So that does nothing. However, if I start a "bare" container with the following: `docker run -v $(pwd)/data:/data -dit wonk"
then run cd /data && chomp, my command runs
I'm confused why these two produce different behavior though. Why doesn't the first run command actually run the chomp command?
that's an excellent question
20:09
Alright I'll be back later thanks for help @rlemon @forresthopkinsa.
is data really a root folder?
why are you using -d
cd /data is very suspect
@JBis see ya
data is located at /data inside the container. In my host it's inside my pwd
20:09
okay, ignore me then
why are you detaching when running interactively
haha, dunno
I just saw that sequence of flags and have always used it to get an interactive shell
I don't even know what that would do
haha guess it works then
but the -d is beside the point in my mind
well if it was backgrounding the interactive tty then it would be relevant
20:11
Because I know the interactive container runs chomp but the "non-interactive" doesn't
hmm, I'll try -d with the former command
But I'd like to understand: say I don't have the -d
no I was more concerned that -d was backgrounding the interactive session and so when you ran chomp it was running it outside the container
but if it's working then that isn't the case
shouldn't the command just run in my shell for the duration of the chomp command inside the container?
not when you run it interactively
can you try replacing /bin/bash -c ... with /data/chomp
see if you can execute it directly
I feel like the problem could be with your bash args
Hmm, but i need to chain lots of commands in my -c section
but does it run chomp if you don't do it that way
20:16
should I move all those commands to /go.sh and then just call that shell script with the docker run command?
no it's not running chomp with the bare run command
I can make this all less mystical and show the actual commands I'm running if you're curious
sure
I'm gonna have to go in a sec though
I'll be here
never used docker tho
hahaha
20:17
so 50/50
rlemon's got it
my google-fu is outstanding
well, let us fu
2
please no
hahaha. Alright. So I'm trying to make it easier for people to create instances of github.com/Bookworm-project/BookwormDB
It's basically open sourced Google Ngrams Viewer
So step one is to download a little sample data (~400MB) on host. This is the only dependency besides docker:
wget https://lab-data-collections.s3.amazonaws.com/sample-bookworm-inputs.tar.gz && \
tar -zxf sample-bookworm-inputs.tar.gz && \
rm sample-bookworm-inputs.tar.gz && \
mv sample-bookworm-inputs data
Then we need to create the Docker image:
# save this hog as Dockerfile
FROM ubuntu:16.04
MAINTAINER Douglas Duhaime <[email protected]>

# config
ENV MYSQL_PASSWORD=womp
ENV MYSQL_ROOT=bwroot
ENV MYSQL_USER=bwuser

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get dist-upgrade -y && \
# store the mysql root password so the installer doesn't prompt for input
echo mysql-server mysql-server/root_password password $MYSQL_PASSWORD | debconf-set-selections && \
echo mysql-server mysql-server/root_password_again password $MYSQL_PASSWORD | debconf-set-selections && \
So far so good
We create the image with:
docker build --tag bookworm:latest --file Dockerfile .
20:21
still no clue, but that project looks mostly abandoned
no activity in a year
And here's where things break down. I want to run the command docker build all inside the container after setting some permissions and starting mysql
4 year old PR sitting there
I'm hellbent on getting this going
And am 95% of the way there
So from here, I can create an interactive shell and can build and visualize the bookworm by running:
docker run -p 8005:8005 -v $(pwd)/data:/data -dit bookworm:built
If, once inside the container, I run:
cp /.my.cnf /etc/mysql/my.cnf && \
cp /.my.cnf /data/bookworm.cnf && \
find /var/lib/mysql -type f | xargs touch && \
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld && \
service mysql start && \
cd /data && \
bookworm build all && bookworm serve
Then after some minutes I can open http://localhost:8005 on my host and see the visualization
My last task is to wrap up this sequence of commands into some kind of wrapper or Docker command so users don't need to type terminal commands inside the container
I thought I could use:
docker run \
-t \
-p 8005:8005 \
-v $(pwd)/data:/data \
bookworm:latest /bin/bash -c " \
cp /.my.cnf /etc/mysql/my.cnf && \
cp /.my.cnf /data/bookworm.cnf && \
find /var/lib/mysql -type f | xargs touch && \
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld && \
service mysql start && \
cd /data && \
bookworm build all \
"
But this does not actually run the commands inside the container
-3
Q: i can't make a login module in reachtJS

Anjani KumariI have created a login module, which uses and endpoint to validate user if they are authentic. clickLogin(){ let username = this.state.username let password = this.state.password //API which returns 200 and true if username and password matched, else false and 403 ...

well thanks for looking @rlemon I shall persist
20:32
no problem 😛
I hope you were not expecting anyhting from me
I told you I don't docker :P
but I'm here for all the moral support you require
how to access angular variable from window scope?
anyone have any idea?
unless it's being shared with the global scope, or is a property of an object that is shared, you're SOL
The scenario is, I've a login service, and it have a function doLogin, which use SE.authenticate. (I'm building a stack app)
Inside SE.authenticate's success callback, I have to set the access token to a variable Token in the service
when it enter's SE.authenticate, the scope changes to global. The variable Token is declared within the service.
how does the 'scope change to global' ?
I used declare var SE:any otherwise it'll throw error. and it become window.SE
when calling this.Token within it, I believe it's calling window.Token
20:44
so you have, inside of a function, var SE:any = ... ?
No. It's on the top just below import section.
okay
This is the code
export class LoginService {
  Token:string;
   doLogin(){
     SE.authenticate({
     success: function(data) {
       this.Token = data.accessToken;
     },
@SagarV Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
the only way to access Token is to have the instance that it is stored in
also, your success function is probably wrong
unless you rebind it somewhere
20:47
and it throws error can not set property
use arrow functions so it doesn't rebind the this scope
success: data => this.Token = data.accessToken;
Just did and build is in progress
that's not going to make it globally available. but it will attach it to the correct spot
I didn't need it globally. I need it within the service.
Yaay it worked
Thanks @rlemon
@SagarV and to figure out why, log this in the success function with the function keyword and with arrows
you'll notice without the arrows, it'll not be the instance of your class
it'll be undefined, or window, or the instance of the calling class
but very unlikely to be what you wanted
arrow functions don't bind a thisArg and instead pull it from the parent scope
20:58
I use arrow functions in vanilla but didn't used it in Angular
did you solve the docker issue
21:41
ngIf isn't working when updating the condition variable via subscribe
22:36
Amazon added live tracking for their delivery trucks
awesome!
I want a dash cam feed
Body cams on the driver?
Yet, they picked a really shitty map provider
just to spite the big G
> The world’s #1 location platform
I can make a website too and claim its number 1
boom
Once you load the page, it will update live regardless whether you have GPS or cell service
Currently, only earth is supported but we are working on other planets
22:51
spectacular

« first day (3265 days earlier)      last day (1906 days later) »