Re: merge conflict in startup_ndslabs.py


On 07/20/2015 01:14 PM, Mike Freemon wrote:
> Hi Kacper,
> 
> Over the weekend, I had a merge conflict which I would like to ask about.
> 
> The relevant portion of the diff is below.  It involves changes to the
> ephemeral service, copying a private key, SFTPing the file
> /mnt/docker-file.  I did not follow exactly what was going on there.  I
> resolved the conflict by not bringing these forward.
> 
> The current version is sitting in branch 'mfreemon-dev' right now, but I
> want to merge that into 'dev' if this resolution to the merge conflict
> is ok.  Let me know.  Thanks...
> 
> - Mike

Hi Mike,
I used to host sparse file pre-populated with all docker images to speed
up the cluster boot. It's a band-aid solution and should be deprecated
in favor of running local docker-registry.

BTW, currently ythub1 is down so it won't work at all. Previous
implementation utilized ephemeral devices that ISL's cloud *used* to
provide. It won't work either.

I'd suggest removing both {format,get}-ephemeral.serice and
var-lib-docker.mount from the startup script.

Cheers,
Kacper


> diff -r ff0edde9c4fb -r 4c4d48ec4b87 startup_ndslabs.py
> --- a/startup_ndslabs.py        Sat Jul 18 14:52:17 2015 -0500
> +++ b/startup_ndslabs.py        Mon Mar 30 15:49:34 2015 -0500
> @@ -1,10 +1,8 @@
>  import argparse
>  import time
>  import os
> -import sys
>  import requests
>  from string import Template
> -import novaclient
>  from novaclient.v1_1 import client
> 
>  CLOUD_CONFIG = Template('''#cloud-config
> @@ -43,28 +41,28 @@
>          [Service]
>          Type=oneshot
>          ExecStart=/usr/bin/systemctl enable docker-tcp.socket
> -    - name: format-ephemeral.service
> +    - name: get-ephemeral.service
>        command: start
>        content: |
>          [Unit]
> -        Description=Formats the ephemeral drive
> +        Description=Gets the docker drive
>          [Service]
>          Type=oneshot
>          RemainAfterExit=yes
> -        ExecStart=/bin/sh -c "/usr/sbin/wipefs -f $$(blkid -L ephemeral0)"
> -        ExecStart=/bin/sh -c "/usr/sbin/mkfs.btrfs -f $$(blkid -L
> ephemeral0) -L ephemeral0"
> +        ExecStartPre=/bin/sh -c "(mkdir /root/.ssh; ssh-keyscan
> ythub1.ncsa.illinois.edu >> /root/.ssh/known_hosts)"
> +        ExecStart=/bin/sh -c "(echo 'lcd /mnt'; echo 'get docker-file';
> echo quit)| sftp core@xxxxxxxxxxxxxxxxxxxxxxxx"
>      - name: var-lib-docker.mount
>        command: start
>        content: |
>          [Unit]
>          Description=Mount ephemeral to /var/lib/docker
> -        Requires=format-ephemeral.service
> -        After=format-ephemeral.service
> +        Requires=get-ephemeral.service
> +        After=get-ephemeral.service
>          Before=docker.service
>          [Mount]
> -        What=LABEL="ephemeral0"
> +        What=/mnt/docker-file
>          Where=/var/lib/docker
> -        Type=btrfs
> +        Type=
>      - name: format-swap.service
>        command: start
>        content: |
> @@ -88,12 +86,19 @@
>      permissions: 0644
>      owner: root
>      content: |
> -$envfile''')
> +$envfile
> +  - path: /root/.ssh/id_rsa
> +    permissions: 0600
> +    owner: root
> +    content: |
> +$scponlykey''')
> 
>  if __name__ == "__main__":
>      parser = argparse.ArgumentParser(description="Spawn our coreOS.")
>      parser.add_argument('--ssh-key', action='store', dest='ssh_key',
>                          default="/home/mturk/core.pub")
> +    parser.add_argument('--scponly-key', action='store', dest='scp_key',
> +                        default="scponly.key")
>      parser.add_argument('--ssh-key-name', action='store',
> dest='ssh_key_name',
>                          default='core')
> [snip]
> 
> <eom>
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature



Other Mailing lists | Author Index | Date Index | Subject Index | Thread Index