Skip to content
Snippets Groups Projects
Commit bee7430c authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch 'newchannel' into 'master'

update install scripts to use our own channel

See merge request !35
parents a850f682 5154fa66
No related branches found
No related tags found
1 merge request!35update install scripts to use our own channel
......@@ -94,13 +94,15 @@ class Gitlab(object):
pipeline = subprocess.check_output(cmd)
return json.loads(pipeline.decode())
def create_merge_request(self, project_id, source_branch, target_branch, title,
assignee_id='', description='', target_project_id='',
labels='', milestone_id='', remove_source_branch=''):
def create_merge_request(self, project_id, source_branch, target_branch,
title, assignee_id='', description='',
target_project_id='', labels='', milestone_id='',
remove_source_branch=''):
url = "projects/{}/merge_requests?"
url += "&".join(['source_branch={}', 'target_branch={}', 'title={}'])
url += "&".join(['assignee_id={}', 'description={}', 'target_project_id={}',
'labels={}', 'milestone_id={}', 'remove_source_branch={}'])
url += "&".join(['source_branch={}', 'target_branch={}', 'title={}',
'assignee_id={}', 'description={}',
'target_project_id={}', 'labels={}',
'milestone_id={}', 'remove_source_branch={}'])
url = url.format(project_id, source_branch, target_branch, title,
assignee_id, description, target_project_id, labels,
milestone_id, remove_source_branch)
......@@ -181,12 +183,15 @@ def main(package, direct_push=False):
f.write(doc)
run_commands(['git', '--no-pager', 'diff'],
['git', 'config', 'user.email', os.environ.get('GITLAB_USER_EMAIL')],
['git', 'config', 'user.name', os.environ.get('GITLAB_USER_ID')],
['git', 'config', 'user.email',
os.environ.get('GITLAB_USER_EMAIL')],
['git', 'config', 'user.name',
os.environ.get('GITLAB_USER_ID')],
['git', 'add', '-A'])
try:
run_commands(['git', 'commit', '-am',
'Update to version {}'.format(stable_version)])
'[{}] Update to version {}'.format(package,
stable_version)])
except ValueError:
print('Feedstock is already uptodate, skipping.')
return
......@@ -202,13 +207,14 @@ def main(package, direct_push=False):
'https://github.com/conda-forge/'
'{}-feedstock/commits/master\n\n'.format(package))
else:
subprocess.call(['git', 'remote', 'set-url', 'origin',
'https://idiapbbb:{}@gitlab.idiap.ch/bob/bob.conda.git'.format(os.environ.get('IDIAPBBB_PASS'))])
origin_url = 'https://idiapbbb:{}@gitlab.idiap.ch/bob/bob.conda.git'
origin_url = origin_url.format(os.environ.get('IDIAPBBB_PASS'))
subprocess.call(['git', 'remote', 'set-url', 'origin', origin_url])
run_commands(['git', 'push', '--quiet', '--force', '--set-upstream',
'origin', branch_name])
gitlab = Gitlab(os.environ.get('GITLAB_API_TOKEN'))
project_id = gitlab.get_project('bob.conda')['id']
title = 'Update-to-version-{}'.format(branch_name)
title = 'Update-to-{}'.format(branch_name)
gitlab.create_merge_request(project_id, branch_name, 'master', title,
remove_source_branch='true')
finally:
......
......@@ -22,51 +22,64 @@ if [ -d ${BASEDIR}/envs/${NAME} ]; then
fi
fi
if [ "$(uname)" == "Linux" ] && [ ${PYTHON_VERSION} == "2.7" ]; then
CAFFE=caffe
else
CAFFE=
fi
# This is needed for toolchain. Since we just use 64-bit, I am not checking if
# the system is 32 bit.
export ARCH=64
# For a complete list of dependencies, please read:
# https://gitlab.idiap.ch/bob/bob/wikis/Dependencies
echo "[>>] Creating environment ${NAME} for python ${PYTHON_VERSION} with bob dependencies..."
${CONDA} create --yes -n ${NAME} --override-channels -c conda-forge -c defaults python=$PYTHON_VERSION \
boost \
${CONDA} create --yes -n ${NAME} \
--override-channels \
-c https://www.idiap.ch/software/bob/conda \
-c defaults \
python=$PYTHON_VERSION \
anaconda=4.2.0 \
boost=1.61 \
${CAFFE} \
cmake \
coverage \
cython \
dask \
cython=0.24.1 \
dask=0.11.0 \
docopt \
ffmpeg \
giflib \
hdf5 \
ipdb \
ffmpeg=2.8.10 \
gcc=4.8.5 \
libgcc=4.8.5 \
giflib=5.1.4 \
hdf5=1.8.17 \
ipython \
jpeg \
libblitz \
libmatio \
libpng \
libsvm \
libtiff \
matplotlib=1 \
nose \
numexpr \
numpy \
jpeg=8d \
libblitz=0.10 \
libmatio=1.5 \
libpng=1.6.22 \
libsvm=3.21 \
libtiff=4.0.6 \
matplotlib=1.5.3 \
nose=1.3.7 \
numexpr=2.6.1 \
numpy=1.11 \
opencv=3 \
pillow \
pip \
pillow=3.3.1 \
pip=8.1.2 \
pkg-config \
psutil \
scikit-image \
scikit-learn \
scipy \
sox \
sphinx \
psutil=4.3.1 \
scikit-image=0.12.3 \
scikit-learn=0.17.1 \
scipy=0.18.1 \
sox=14.4.2 \
sphinx=1.4.6 \
sphinx_rtd_theme \
sqlalchemy \
sqlalchemy=1.0.13 \
tensorflow \
toolchain \
virtualenv \
vlfeat
# Commented out while @amohammadi fixes it in conda-forge
#if [ "$(uname)" == "Linux" ] && [ ${PYTHON_VERSION} == "2.7" ]; then
# ${CONDA} install --yes -n ${NAME} --override-channels -c conda-forge -c defaults caffe
#fi
vlfeat=0.9.20
echo "[>>] Pip-installing extra dependencies in environment ${NAME} for ${PYTHON_VERSION}..."
source ${BASEDIR}/bin/activate ${NAME}
......@@ -76,7 +89,7 @@ cyvlfeat=git+https://github.com/menpo/cyvlfeat@v0.4.5
if [ "$(uname)" == "Linux" ]; then
CFLAGS="-I${CONDA_PREFIX}/include" LDFLAGS="-L${CONDA_PREFIX}/lib -lvl -Wl,-rpath=${CONDA_PREFIX}/lib" pip --no-cache-dir install ${cyvlfeat}
else
CFLAGS="-I${CONDA_PREFIX}/include -mmacosx-version-min=10.9" LDFLAGS="-L${CONDA_PREFIX}/lib -lvl -Wl,-headerpad_max_install_names" pip --no-cache-dir install ${cyvlfeat}
CFLAGS="-I${CONDA_PREFIX}/include" LDFLAGS="-L${CONDA_PREFIX}/lib -lvl" pip --no-cache-dir install ${cyvlfeat}
fi
pip --no-cache-dir install \
......@@ -84,7 +97,8 @@ pip --no-cache-dir install \
git+https://github.com/menpo/menpofit@v0.4.1 \
schema \
pyedflib \
mne
mne \
ipdb
echo "[>>] Bye!"
exit 0
......@@ -29,13 +29,9 @@ if [ ! -x ${CONDA} ]; then
echo "[>>] Creating root environment and setting basic options..."
bash ${MINICONDA} -b -p ${BASEDIR}
${CONDA} config --set show_channel_urls True
${CONDA} config --add channels conda-forge
${CONDA} config --add channels defaults
${CONDA} config --add channels https://www.idiap.ch/software/bob/conda
fi
echo "[>>] Updating conda in the root environment..."
${CONDA} update --yes -n root conda
echo "[>>] Installing conda-smithy..."
${CONDA} install --yes -n root conda-smithy
echo "You need to manually install https://hub.github.com/ too ..."
......@@ -122,7 +122,7 @@ def main(packages_list):
last_pipeline['id'], package))
time.sleep(30)
last_pipeline = gitlab.get_pipeline(pid, last_pipeline['id'])
if not last_pipeline['status'] == 'passed':
if not last_pipeline['status'] == 'success':
print('Pipeline {} for project {} failed. Exiting ...'.format(
last_pipeline['id'], package))
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment